Build the UI
Studio is a dynamic way to build and customize gaming experiences in your app. Our SDK has been optimized and unified so that integrating with iOS, Android, or cross-platform frameworks is easier than ever.
Below are guidelines for building your own UI. The models are shared across platforms, though there are slight syntax differences when calling SDK methods.
1. Create a Catalog
Call
PlaytimeStudio.getCampaigns()Use field
iconImageto display the icon image of the appUse
totalCoinsPossibleto display the maximum amount of rewards available per gameCall
PlaytimeStudio.openInStore()to take the user to the App Store to install the gameUse
appNameto display the name of the app

2. Show Installed Campaigns
Call
PlaytimeStudio.getInstalledApps()Use
iconImageto display the icon image of the appUse
appNameto display the name of the appUse
totalCoinsPossibleto display the maximum amount of rewards available per game
Promotions: use the PlaytimePromotion class to show when there is a promotion. The promotion must be enabled through the Monetize Dashboard first.
Use
promotion.boostFactorto determine how much to multiply the rewards. For example, for a boost factor of 2, rewards get doubled. If a boostFactor is exists in the response, it means the install was made with an active promotion.To show points with a promotion: use the
totalCoinsPossibleoramountthe and multiply this by thepromotion.boostFactor.

3. Show the Offer Details
Depending on if you're showing the offer details from the catalog or the installed app, use the response from PlaytimeStudio.getCampaigns or PlaytimeStudio.getInstalledCampaigns()respectively.
Use
imageto display the landscape image of the appUse
iconImageto display the app iconUse
appNameto display the app nameUse
rewardingExpiresAtto display how long the user has to play the game before they're ineligible for rewardsUse
totalCoinsPossibleto show the total amount of rewards available to the user for that offerUse
appDescriptionto show app detailsFrom
playtimeRewardAction, usenameto display description of of the eventFrom
playtimeRewardAction, useamountto display the amount of coins available for the eventCall
PlaytimeStudio.openInStore()orPlaytimeStudio.openInstalledApp()to take the user to the App Store to install the game
For Time-based Games:
Use
playDurationto display how many minutes the user must play to be rewardedUse
levelto indicate the time-baed milestone the user must complete
Repeatable Milestones:
Use
rewardsCountto show how many times the level can be repeated for rewards
For installed games:
Use
rewardedAtto display that a level was completedUse
isCompletedto indicate that all levels of the game are done

4. Time Boosted Milestones
Use PlaytimeRewardAction to get all required values
timedCoinsDurationis returned in minutes to show how long the user has to complete the leveltimedCoinsto get the boosted amount of coins availableoriginalCoinsto show the amount of coins the user would get without the booster applied
Optional fields
isTimedto check whether the event is time-boosted or notBoosterExpiresAtis available once the game is installed to show how long the user has to get the boosted rewards.
Notes
If there is an active promotion, the promotion will not be applied to the time-boosted milestones
5. Cashback
Use PlaytimeCashbackConfig
ExchangeRate- this is the amount of coins the user gets per 1$ spentmaxLimitPerCampaignCoins- this is the total cashback amount users can get (exchangeRate×maxLimitPerCampaignUSD).
After the user has installed the game and made a purchase you can use:
completedRewards.PlaytimeCashbackReward-> to show all of the rewards the user has gotten for cashback, usetotalCoinsPlaytimeCashbackReward: to show the pending or received cashback rewards, usecoinsPlaytimeCashbackReward: to show when the user made a purchase and when they received their cashback rewards, usereceivedAtorprocessedAt
Notes:
Promotions do not apply to cashback
Users are able to repeat the rewarded action, your UI should take this into consideration

Last updated