ayet-react-native-sdk-v2
v1.0.0
Published
The React Native wrapper for the Ayet SDK
Readme
ayet-react-native-sdk-v2
React Native plugin for the ayetstudios SDK. Monetize your app and reward users with in-app currency through offers and surveys.
Requirements
- iOS 13+
- Android minSdk 24 (Android 7.0)
Getting Started
Before integrating, make sure you have:
- Created an ayetstudios account
- Added a Placement (Android or iOS)
- Added an AdSlot
See Dashboard Setup for details.
Important: Your placement package name must match your app's package name, or the SDK won't initialize.
Installation
npm install ayet-react-native-sdk-v2Android Setup
Add the internet permission to your AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<application>
...
</application>
</manifest>iOS Setup
Install pods:
cd ios && pod installInitialize the SDK
import AyetSdkV2 from 'ayet-react-native-sdk-v2';
// Initialize with your placement ID and user identifier
AyetSdkV2.init(YOUR_PLACEMENT_ID, 'USER_EXTERNAL_IDENTIFIER');The externalIdentifier is your user's ID, accessible in conversion callbacks via {external_identifier}. The placementId is found in your dashboard.
Show the Offerwall
AyetSdkV2.showOfferwall('YOUR_OFFERWALL_ADSLOT_NAME');The adslot name is found by clicking the adslot in your dashboard. Only available for Offerwall adslots.
Show the Surveywall
AyetSdkV2.showSurveywall('YOUR_SURVEYWALL_ADSLOT_NAME');Only available for Surveywall adslots.
Show Reward Status
The Reward Status page shows clicked/in-progress offers and allows users to submit support tickets.
AyetSdkV2.showRewardStatus();Fetch Offers
Get all offers in JSON format (Offerwall API adslots only):
const offersJson = await AyetSdkV2.getOffers('YOUR_OFFERWALL_API_ADSLOT_NAME');Set Custom Parameters
Set up to 5 custom parameters for callbacks:
AyetSdkV2.setTrackingCustom1('custom1');
AyetSdkV2.setTrackingCustom2('custom2');
AyetSdkV2.setTrackingCustom3('custom3');
AyetSdkV2.setTrackingCustom4('custom4');
AyetSdkV2.setTrackingCustom5('custom5');Custom parameters must also be added to your callback URL to receive them in S2S callbacks.
Set Age and Gender
Optionally pass user demographics to improve offer matching:
import AyetSdkV2, { AyetGender } from 'ayet-react-native-sdk-v2';
AyetSdkV2.setAge(25);
AyetSdkV2.setGender(AyetGender.Male);Documentation
See docs.ayetstudios.com for full documentation including callback setup and testing.
License
MIT
