SDK Methods

All methods are thread safe and all SDK operations are performed on an internal actor, so the SDK API calls will never block the main thread.

The Playtime Studio SDK's entry point class offers methods to retrieve campaigns and installed apps. This enables you to display them in your custom UI and guide users to the App Store for installation.

Whenever the SDK hash is provided, the SDK will be reinitialized and we will use the new hash for all subsequent requests.

static func setPlaytimeOptions(options: PlaytimeOptions) async throws

Get the list of campaigns. Use the Campaign model returned in the response to make your unique Playtime catalog. There are two options for calling this method: with and without a token (provided by the Offer API).

The playtimeOptions object is required to have the specific userId in order for rewards to be mapped back to the user correctly.

static func getCampaigns(options: PlaytimeOptions) async throws -> PlaytimeCampaignsResponse
static func getCampaigns(token: String, options: PlaytimeOptions? = nil) async throws -> PlaytimeCampaignsResponse

The SDK handles all the actions related to navigating to the App store and the eventual install following a user’s action, taking care of tracking & app install measurement.

static func openInStore(campaign: PlaytimeCampaign) async throws

Get the list of the campaigns that the user has already installed. Use the Campaign model returned in the response to make your unique "In Progress" catalog.

The SDK handles all the actions related to navigating to the App store to open the app.


The options passed to Playtime methods.

The userId is custom identifier you must assign to each user. This ID is necessary for S2S payouts, thus required. Ensure this value is url-safe and that the value is never empty.

Our game recommendations are personalized through algorithms that consider users' preferences and gender information. If a user consents to share their gender and/or birthday, you can share this information with adjoe to enhance the customization of game suggestions.

Use PlaytimeUserProfileBuilder: it accepts date and converts it to an ISO string.

To make the most of the Playtime SDK, to maximize your revenue and provide the best user experience, use all of these parameters for data-driven optimizations. For instance, you can monitor the performance of different button placements or determine the effectiveness of different UA sources.

These values must be url-safe as they could be returned as query parameters in the S2S Payout request.

Parameter
Explanation

uaNetwork

User Acquisition Network. The network through which the user was acquired, e.g., Adwords, Facebook, or Organic.

uaChannel

User Acquisition Channel. The channel within the network from which the user was acquired, e.g. incentivized or video campaigns.

uaSubPublisherCleartext

The cleartext package name of the sub-publisher's app ID within the network from which the user was acquired, e.g., com.domain.appName.

uaSubPublisherEncrypted

The encrypted package name or app ID of the sub-publisher's app from the network where the user was acquired.

placement

The placement of the Playtime Catalog inside your app, e.g., "Main Screen", "Shop", "Interstitial", "More Diamonds Screen", etc.

You can also choose to use adjoe's Apps feature, showing the Playtime catalog with distinct gaming or app experiences.

Option
Explanation

nongaming

Only shows non-gaming campaigns

gaming

Only shows gaming campaigns

both

Shows both gaming and non-gaming

Optional identifiers that are provided back in the S2S payout URL.

Returns the initialization status (successful / error) and the user's fraud status as a boolean.


Open the Playtime Catalog.

Errors that can be thrown by the SDK:

Last updated