Premium Offers
Tyrads SDK introduces native React components that allow you to render premium offers directly within your application's UI, providing a more integrated and seamless user experience compared to the traditional modal offerwall.
Components Overview
The SDK exports two primary components for native widget implementation:
PremiumOffersWidget: The main component that fetches and displays premium offers.PremiumOffersWidgetLoading: A placeholder component that provides a skeleton/shimmer effect during data fetching.
Basic Usage
To use the premium widget, simply import it and place it anywhere in your JSX tree.
import React from 'react';
import { View, ScrollView } from 'react-native';
import { PremiumOffersWidget, PremiumWidgetStyles } from '@tyrads.com/tyrads-sdk';
const MyGameScreen = () => {
return (
<ScrollView>
{/* Other game content */}
<PremiumOffersWidget
widgetStyle={PremiumWidgetStyles.list}
launchMode={2}
/>
{/* Other game content */}
</ScrollView>
);
};Widget Styles
The PremiumWidgetStyles enum allows you to choose between two distinct layouts:
PremiumWidgetStyles.list
Renders offers in a vertical list format (Best for dedicated offer screens).
PremiumWidgetStyles.sliderCards
Renders offers in a horizontal swipeable carousel (Best for home screens or small spaces).
Available Widget Style options


Example (Slider Style):
Prop Reference
PremiumOffersWidget
widgetStyle
PremiumWidgetStyles
list
Determines the layout of the widget.
launchMode
number
2
Determines presentation style on iOS (2: Embedded, 3: External Safari).
PremiumOffersWidgetLoading
widgetStyle
PremiumWidgetStyles
list
Matches the skeleton layout to your intended widget style.
Handling Loading States
For the best user experience, it's recommended to show the loading placeholder while the SDK is initializing or fetching data.
Best Practices
Container Sizing: The
PremiumOffersWidgetis designed to be flexible. If using theliststyle inside aScrollView, ensure it doesn't have a fixed height unless intended.Launch Mode Compatibility: Remember that
launchModeonly affects iOS presenting behavior. On Android, the offer details always open in the standard view.Key Management: If your app supports multiple configurations or user switching, you can use the
keyprop on the widget to force a re-render when initialization data changes.
Last updated