For the complete documentation index, see llms.txt. This page is also available as Markdown.

SDK Native - Data Reference

Complete reference for the data objects available in the React Native campaigns SDK. The types and constants below are exported from mychips-react-sdk.


MCCampaign

The main campaign object passed to renderCampaign(campaign, index) and onCampaignsLoaded.

Field

Type

Description

id

string

Unique campaign identifier.

name

string

Campaign display name.

type

string

Campaign type. See MCCampaignType constants below.

creatives

MCCreatives

Image URLs (see below).

links

MCLinks

Tracking and navigation URLs (see below).

totalConvertedValue

number

Total reward in your virtual currency, including promo.

remainingConvertedValue

number

Remaining reward the user can earn.

promoRatio

number

Promotional multiplier (1 = no promo, 2 = double).

progress

MCProgress | null

User's progress; null if the user has not started.

MCCreatives

Image assets for a campaign.

Field

Type

Description

thumbnail

string | null

Small square preview image URL.

cover

string | null

Full-size banner image URL.

Tracking and navigation URLs. MCNativeAdView handles impressions and default clicks automatically.

Field

Type

Description

trackingUrl

string | null

Click tracking URL.

trackingPixelUrl

string | null

Impression pixel URL, fired automatically for visible campaigns.

detailUrl

string | null

Campaign detail page URL, opened on a default click.

MCProgress

User progress on a campaign. campaign.progress is null when the user has not started it.

Field

Type

Description

status

string

Progress status. See MCCampaignStatus constants below.

eventsCompleted

number

Number of events the user has completed.

totalEvents

number

Total events required to complete the campaign.

valueEarned

number

Reward earned so far in your virtual currency.

progressValue

number

Completion percentage (0–100).

MCMeta

Response metadata returned alongside the campaign list.

Field

Type

Description

version

string

API response format version.

count

number

Number of campaigns returned.

The exported MCCampaignResponse type contains campaigns: MCCampaign[] and meta: MCMeta. In the view callback, metadata is provided as the second argument: onCampaignsLoaded={(campaigns, meta) => { ... }} .

MCCampaignType (constants)

Known campaign type values. Compare against campaign.type:

Constant

Value

MCCampaignType.MULTI_REWARD

"MultiReward"

MCCampaignType.PLAY_TO_EARN

"Play2Earn"

MCCampaignType.SINGLE_REWARD

"SingleReward"

The type field is a string, not a closed enum. Your app should allow for new values.

MCCampaignStatus (constants)

Known progress status values. Compare against campaign.progress?.status:

Constant

Value

MCCampaignStatus.CLICKED

"clicked"

MCCampaignStatus.STARTED

"started"

MCCampaignStatus.INSTALLED

"installed"

MCCampaignStatus.COMPLETED

"completed"

MCCampaignStatus.EXPIRED

"expired"

MCCampaignStatus.CLOSED

"closed"

The status field is a string, not a closed enum. Your app should allow for new values.

Image Loading

For a custom React Native card, use React Native's Image component with a campaign image URL:

React Native loads the remote image and updates it when the source changes. You can use your own image library if preferred. For a small square card, choose thumbnail first; for a wide card, choose cover first. Animated GIF playback on Android depends on the host app's image support and is separate from these data types.

External References

For additional template examples and field mappings, see the Figma Showcase.

Last updated