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

  1. Call PlaytimeStudio.getCampaigns()

  2. Use field iconImage to display the icon image of the app

  3. Use totalCoinsPossible to display the maximum amount of rewards available per game

  4. Call PlaytimeStudio.openInStore() to take the user to the App Store to install the game

  5. Use appName to display the name of the app

2. Show Installed Campaigns

  1. Call PlaytimeStudio.getInstalledApps()

  2. Use iconImage to display the icon image of the app

  3. Use appName to display the name of the app

  4. Use totalCoinsPossible to 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.

  1. Use promotion.boostFactor to 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.

  2. To show points with a promotion: use the totalCoinsPossible or amount the and multiply this by the promotion.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.

  1. Use image to display the landscape image of the app

  2. Use iconImage to display the app icon

  3. Use appName to display the app name

  4. Use rewardingExpiresAt to display how long the user has to play the game before they're ineligible for rewards

  5. Use totalCoinsPossible to show the total amount of rewards available to the user for that offer

  6. Use appDescription to show app details

  7. From playtimeRewardAction, use name to display description of of the event

  8. From playtimeRewardAction, use amount to display the amount of coins available for the event

  9. Call PlaytimeStudio.openInStore() or PlaytimeStudio.openInstalledApp()to take the user to the App Store to install the game

For Time-based Games:

  • Use playDuration to display how many minutes the user must play to be rewarded

  • Use level to indicate the time-baed milestone the user must complete

Repeatable Milestones:

  • Use rewardsCount to show how many times the level can be repeated for rewards

For installed games:

  • Use rewardedAt to display that a level was completed

  • Use isCompleted to indicate that all levels of the game are done

4. Time Boosted Milestones

Use PlaytimeRewardAction to get all required values

  1. timedCoinsDuration is returned in minutes to show how long the user has to complete the level

  2. timedCoins to get the boosted amount of coins available

  3. originalCoins to show the amount of coins the user would get without the booster applied

Optional fields

  • isTimed to check whether the event is time-boosted or not

  • BoosterExpiresAt is 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

  1. ExchangeRate - this is the amount of coins the user gets per 1$ spent

  2. maxLimitPerCampaignCoins - 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:

  1. completedRewards.PlaytimeCashbackReward -> to show all of the rewards the user has gotten for cashback, use totalCoins

  2. PlaytimeCashbackReward : to show the pending or received cashback rewards, use coins

  3. PlaytimeCashbackReward : to show when the user made a purchase and when they received their cashback rewards, use receivedAt or processedAt

Notes:

  • Promotions do not apply to cashback

  • Users are able to repeat the rewarded action, your UI should take this into consideration

Last updated