Dashboard

Initialization

In order to access the functionalities of the AppsPrize Playtime SDK, it is necessary to perform an initialization process. To achieve this, simply make a call toAppsPrize.init(Config)when your app is starting.

The initialization will occur asynchronously in the main application process, running in the background. Upon completion, you will be notified through the AppsPrize.init's onInitialize or onInitializedFailed method, depending on the outcome.

onRewardUpdate: This function will let you know that the user has completed one or multiple rewards in a session.

🚧

Please make sure that "userId" and "token" have not an empty value. Also, "country" should be defined for country targeting. We need to get device locale into the SDK in order to fill the feed with relevant offers.

const appsPrizeConfig: AppsPrizeConfig = {
    /// The token used for authentication.
    token: "token";

    // The advertising identifier used for tracking.
    advertisingId: "adId";

    // The user identifier.
    userId: "userId";

    // (Optional) The country associated with the user.
    country: "EN";

    // (Optional) The language preference of the user.
    language: "en";

    // (Optional) The styling configuration for UI customization.
    style: AppsPrizeStyleConfig;
}
AppsPrize.init(config, {
  onInitialize: (event) => {
    console.log("AppsPrize:TS:onInitialize")
  },
  onInitializeFailed: (event) => {
    console.log(`AppsPrize:TS:onInitializeFailed:${JSON.stringify(event)}`)
  },
  onRewardUpdate: (event) => {
    console.log(`AppsPrize:TS:onRewardUpdate:${JSON.stringify(event)}`)
  }
})

You can set the parameters in config object;

  • String token: The SDK token that you can take it from the dashboard once you add your app.
  • String userId: A custom user identifier that you give to your users. With the help of this ID, we will match the payouts to your users and inform you by server-to-server payout method.

UI Customization

With the version 0.4.0, you will be able to customize the UI of the SDK and use your own brand colors, font types, and header banner. So, you can increase your users' experience.

const styleConfig: AppsPrizeStyleConfig = {
    // (Optional) primaryColor: The primary color used for UI customization. Set primary color to red.
    primaryColor: "#FF0000",

    // (Optional) secondaryColor: The secondary color used for UI customization. Set secondary color to blue.
    secondaryColor: "#0000FF",

    // (Optional) typeface: The typeface used for UI customization. Set typeface to an assets path.
    typeface: "path/to/typeface.ttf",

    // (Optional) bannerDrawable: The drawable used for the header banner.
    // Set banner drawable to a specific drawable resource. (name of the resource)
    bannerDrawable: "header_banner",

    // (Optional) offersTitleText: Text for the offers page title and navigation. Set offers title text.
    offersTitleText: "Offers",

    // (Optional) appsTitleText: Text for the apps page title and navigation. Set apps title text.
    appsTitleText: "Apps",

    // (Optional) item: Styling for items and item detail popup.
    item: {
        // (Optional) backgroundGradientColors: List of gradient colors used for item backgrounds.
        backgroundGradientColors: [
            ["#0F83DC", "#2FAAF0"],
            ["#96001D", "#E1002C"],
            ["#9A0FDC", "#B36AFC"],
            ["#DC7E0F", "#F0C62F"]
        ],

        // (Optional) currencyIconDrawable: The drawable is used as the currency icon in the item CTA. Set currency icon drawable.
        currencyIconDrawable: "path/to/currency_icon"
    },

    // (Optional) navigation: Styling for bottom navigation.
    navigation: {
        // (Optional) backgroundColor: The background color of the bottom navigation. Set navigation background color to black.
        backgroundColor: "#000000",

        // (Optional) selectColor: The color of the selected item in the bottom navigation. Set selected item color to green.
        selectColor: "#00FF00",

        // (Optional) deselectColor: The color of the deselected items in the bottom navigation. Set deselected item color to gray.
        deselectColor: "#808080"
    }
};

What’s Next