Initialization

This is now outdated please download V1.1

Integrating the Tyrads offerwall functionality into your application is a straightforward process that involves a few key steps. By following these integration steps, you can seamlessly incorporate the offerwall feature, enhancing user engagement and potentially generating revenue for your application.

  1. Initialization

SDK Initialization best practices:

  • Initiate early: It's advisable to initialize the SDK promptly after your app launches to ensure that all Tyr SDK functionalities are accessible when needed.

  • Initiate post-app authentication: Re-initiate the SDK with current user details immediately after your user signs up or signs in to the app to update the userId.

  • Initiate periodically: To optimize user experience, we strongly suggest invoking this method each time your app is brought to the forefront. This shouldn't impact your app's performance noticeably.

This step initializes the Tyrads SDK within your application. You need to provide the API key and API secret obtained from the Tyrads platform. This allows your app to communicate securely with Tyrads' servers.

Tyrads.getInstance().init(context, apiKey: "xyz", apiSecret:"abc123");
  1. User Login

Upon initializing the SDK, the mandatory step is to log in the user. However, passing a user ID is optional and is only necessary when the publisher operates its own user system. This login process ensures that user interactions with the offerwall are accurately tracked and attributed within the application.

await Tyrads.getInstance().loginUser(userID: "xxx");//userID is optional 

The generated user ID from the SDK is based on the device identifier (GAID/OAID/IDFA)

  • If your app user resets the device identifier, your user will lose the progress data

  • If the SDK can't access the device identifier, it will generate its own device identifier and store it in the app storage. If this is the case, your app user will lose the progress data when the user uninstalls the app

  • If you send us your userId within userId field from your backened we will save this and even if the user changes their device ID we will keep their progress.

  1. Show Offerwall

Once the SDK is initialized and the user is logged in (if applicable), you can display the offerwall to the user. This typically involves calling a function provided by the Tyrads SDK, such as showOffers. The offerwall is where users can engage with various offers, advertisements, or promotions provided by Tyrads, potentially earning rewards or incentives in the process.

Tyrads.getInstance().showOffers();

Last updated