SDK
v2.0
v2.0
  • Getting Started
    • Welcome
    • Start Here
    • Postback Payout (S2S)
    • Advanced options
      • Sending Media Source Data
      • Sending User Segments / User Info
  • Unity
    • Installation
    • Initialization
    • Obtaining Adverstising ID's
  • Android
    • Prerequisite
    • Installation
    • Initialization
      • Deeplinking Routes
      • Premium Offers
    • Obtaining Adverstising ID's
  • Flutter
    • Prerequisite
    • Installation
    • Initialization
      • Deeplinking Routes
      • Premium Offers
      • changeLanguage
    • Obtaining Advertising ID's
  • REACT NATIVE
    • Prerequisites
    • Installation
    • Initialization
      • Deeplinking Routes
      • Premium Offers
    • Obtaining Advertising ID's
  • Web / Iframe
    • Initialization
    • Premium Widgets
  • Questions and troubleshooting
    • Reporting bugs
    • Known issues
    • Changelog
Powered by GitBook
On this page
  • 1. Initialization
  • 1.1 Advanced Practices for intialization for personalized rewards
  • 2. User Login
  • 3. Show Offerwall
  • TopPremiumOffers Composable Function
  1. Android

Initialization

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");
Tyrads.getInstance().init(context, "xyz", "abc123");

1.1 Advanced Practices for intialization for personalized rewards

To maximize the value to the user sending us more data about the user and where they came from allow us to customize the reward experience. This can be used to provide feedback of quality of users aswell as customize the earnings journey of different segments of users.

To maximize the value of our Tyr SDK please follow the advanced options for intialization. This will allow us to personalize the rewards for the user event further and maximize the earnings for you as publisher.

Sending Media Source Data

Sending User Segments / User Info

2. 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 
Tyrads.getInstance().loginUser("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.

3. 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();
Tyrads.getInstance().showOffers();

Deeplinking Routes

Min SDK version required: v1.1.8

The Tyrads SDK supports deeplinking to specific sections of the offerwall. When initializing or interacting with the SDK, you can specify a route to open a particular page. For campaign-specific routes, you'll need to provide the campaignID as well.

Available routes and their usage:

  • campaigns - opens the Campaigns Page

  • campaigns-activated - opens the Activated Campaigns Page

  • campaign-details - opens the Campaign Details Page (requires campaignID)

  • campaign-tickets - opens the Campaign Tickets Page (requires campaignID)


// Note: CAMPAIGNS is the default route when no specific route is provided
Tyrads.getInstance().showOffers();

// Explicitly specifying the Campaigns Page
Tyrads.getInstance().showOffers("campaigns");

// Activated Campaigns Page
Tyrads.getInstance().showOffers("campaigns-activated");

// Campaign Details Page (requires campaignID)
Tyrads.getInstance().showOffers("campaign-details", "your_campaign_id_here");

// Campaign Tickets Page (requires campaignID)
Tyrads.getInstance().showOffers("campaign-tickets", "your_campaign_id_here");

TopPremiumOffers Composable Function

Overview

The TopPremiumOffers composable function is designed to display top premium offers within the application. It utilizes the TopOffers composable to render the offers with specific settings.

Parameters

This function accepts the following parameters with default values:

  • showMore: A boolean indicating whether to display a "show more" option. Defaults to true.

  • showMyOffers: A boolean indicating whether to show the user's personal offers. Defaults to true.

  • showMyOffersEmptyView: A boolean indicating whether to display an empty view when there are no personal offers. Defaults to false.

  • style: An integer specifying the visual style or layout for the offers. Defaults to 2. Available styles are:

    • Available Style options

      • Style 1: Default style.

      • Style 2: Currently used.

      • Style 3: Alternate layout.

      • Style 4: Advanced layout.

Configuration

The TopOffers composable is configured using the provided parameters, except for the style which is always set to 2 regardless of the input.

  • showMore: Set based on the showMore parameter.

  • showMyOffers: Set based on the showMyOffers parameter.

  • showMyOffersEmptyView: Set based on the showMyOffersEmptyView parameter.

  • style: Always set to 2, regardless of the input.

Usage

To use this composable, you can call it through the Tyrads instance like this:

Tyrads.getInstance().TopPremiumOffers(
    showMore = true,
    showMyOffers = true,
    showMyOffersEmptyView = false,
    style = 2,
)

Or, use the default values:

Tyrads.getInstance().TopPremiumOffers()

Notes

  • Style Parameter: The style parameter is not currently used to change the style of the offers; it always defaults to 2. Consider updating the function to use this parameter effectively.

PreviousInstallationNextDeeplinking Routes

Last updated 2 months ago

You can check the working example of the SDK here:

https://github.com/tyrads-com/tyrads-sdk-android
Option 1
Option 2
Option 3
Option 4