TyrAds

Level up your gaming experience with

Tyrads lets you integrate offers in your app in simple and easy to follow steps.

Tyrads

Tyrads is an open source framework that provides a wrapper for presenting and creating offerwall. It interacts with the Tyrads backend letting you easily show offers with only few lines of code!

Key Features

  • Full Support for FCM & APNS: Rich-media notifications for Android and iOS with background state handling.
  • Limited Time Offers & Currency Sales: Engaging in-app promotion dialogs with countdown timers and automated routing.
  • Dynamic Placement Support: Use placementId to enable user-specific currency settings based on ad placements.
  • Remote Localization: Automatic translation updates with SHA-256 verification and local caching.
  • Advanced Security: Hardware-level telemetry (GPU, sensors) and Play Integrity integration to prevent fraud.
  • Optimized Performance: Enhanced loading and caching mechanisms for a smoother UX across all widgets.

Note: Apps designed for Children and Families program should not be using Tyrads SDK, since Tyrads does not collect data from users less than 13 years old

Note: Tyrads SDK utilizes Apple's Advertising ID (IDFA) on iOS and GAID on Android to identify and retarget users with campaigns. You should initialize Tyrads Flutter plugin only if the relevant IDFA/GAID permission was granted by the user


Getting Started

Prerequisites

  • Android SDK 21 or higher using Google Play Services
  • iOS version 11.0 or higher
  • Flutter version 3.22.0 or higher
  • Dart SDK version 3.4.0 or higher
  • CocoaPods version 1.10.0 or higher

Installation

Just open the terminal with project root working and type below command

flutter pub add tyrads_sdk

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

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.

  // Create a navigator key for the Tyrads SDK
  final navigatorKey = GlobalKey<NavigatorState>();

  // Initialize the SDK
  await Tyrads.instance.init(
    navigatorKey: navigatorKey, // Required
    apiKey: "xyz",
    apiSecret: "abc123",
  );

From version 1.1.2, you can also pass the user & media source information to the SDK. This information is used to personalize the user experience and improve the accuracy of attribution. You can know about each parameter in the documentation.

  // Create a navigator key for the Tyrads SDK
  final navigatorKey = GlobalKey<NavigatorState>();

  // Initialize the SDK with user & media source information
  await Tyrads.instance.init(
    navigatorKey: navigatorKey,
    apiKey: Env.TYRADS_SDK_KEY,
    apiSecret: Env.TYRADS_SDK_SECRET,
    encryptionKey: "12345", // Optional: AES-GCM encryption of sensitive tracking data
    placementId: "12345", // Optional: Dynamic placement ID
    engagementId: "12345", // Optional: Engagement ID
    userInfo: TyradsUserInfo(
      email: "example@tyrads.com",
      phoneNumber: "001234567890",
      userGroup: "High purchase user",
      age: 25,
      gender: 1, // 1: Male, 2: Female
    ),
    mediaSourceInfo: TyradsMediaSourceInfo(
      mediaSourceName: "Facebook",
      mediaCampaignName: "Summer2023Promo",
      mediaSourceId: "FB001",
      mediaSubSourceId: "FB001_Stories",
      incentivized: false,
      mediaAdsetName: "YoungAdults25-34",
      mediaAdsetId: "AD001",
      mediaCreativeName: "SummerSale_Video",
      mediaCreativeId: "CR001",
      sub1: "ReferralCode123",
      sub2: "OrganicInstall",
      sub3: "HighValueUser",
      sub4: "FirstTimeUser",
      sub5: "iOSDevice",
    ),
  );

init Parameters

Parameter Type Required Description
navigatorKey GlobalKey<NavigatorState> Yes Required for displaying in-app notifications and promotion dialogs.
apiKey String Yes Your TyrAds API Key.
apiSecret String Yes Your TyrAds API Secret.
encryptionKey String No Key used for AES-GCM encryption of sensitive tracking data.
engagementId String No Unique ID for the engagement campaign.
placementId String No ID to enable dynamic coin selection and user-specific currency settings.
mediaSourceInfo TyradsMediaSourceInfo No Attribution details (media source, campaign, creative, etc.).
userInfo TyradsUserInfo No User details for personalization (email, phone, age, gender).
config TyradsConfig No Android only: SDK configuration options.
launchMode TyradsLaunchMode No Preferred launch mode (inAppWebView or externalBrowser).

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.

var isLoginSuccessful = await Tyrads.instance.loginUser(userID: "xxx");//userID is optional 

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.

  await Tyrads.instance.showOffers();

Deeplinking Routes

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:

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

// Explicitly specifying the Campaigns Page
await Tyrads.instance.showOffers(route: TyradsDeepRoutes.OFFERS);

// Activated Campaigns Page
await Tyrads.instance.showOffers(route: TyradsDeepRoutes.ACTIVE_OFFERS);

// Campaign Details Page (requires campaignID as int)
await Tyrads.instance.showOffers(route: TyradsDeepRoutes.OFFERS, campaignID: 12345);

// Campaign Tickets Page (requires campaignID as int)
await Tyrads.instance.showOffers(route: TyradsDeepRoutes.SUPPORT, campaignID: 12345);

showOffers Parameters

Parameter Type Required Description
campaignID int No ID of a specific campaign to open directly.
route String No Deep link route (use TyradsDeepRoutes).
launchMode TyradsLaunchMode No Override the default launch mode for this call.

Advanced Features

In-App Promotions

The SDK automatically manages Limited Time Offers and Currency Sales based on remote configurations. Ensure you have provided a navigatorKey during init to allow the SDK to present promotion dialogs seamlessly.

Remote Localization

Translations are fetched remotely and cached locally. You can manually change the SDK language using:

await Tyrads.instance.changeLanguage("es"); // Spanish



Android 12

Apps updating their target API level to 31 (Android 12) or higher will need to declare a Google Play services normal permission in the AndroidManifest.xml file.

Navigate to the android/app/src/main directory inside your project's root, locate the AndroidManifest.xml file and add the following line just before the <application>.

<uses-permission android:name="com.google.android.gms.permission.AD_ID" />

You can read more about Google Advertising ID changes here.


iOS 14+

You need to add NSUserTrackingUsageDescription to info.plist file like

<key>NSUserTrackingUsageDescription</key>
<string>We use device identification to personalize your rewards experience, track your progress, and provide tailored offers. This helps us improve our services and ensure you get the most value from our rewards program.</string>

Tyrads SDK can work with or without the IDFA permission on iOS 14+. If no permission is granted in the ATT popup, the SDK will serve non personalized offers to the user. In that scenario the conversion is expected to be lower. Offerwall integrations perform better compared to when no IDFA permission is given. Our recommendation is that you should ask for IDFA usage permission prior to Tyrads sdk initialization.

Libraries

tyrads_sdk