Use the SDK
1
2
Set Up PlaytimeOptions and ShowCatalog
// The setPlaytimeOptions method will return a Future<void> which succeeds when the SDK has been initialized successfully and fails with an error when the initialization fails. Make sure to call setPlaytimeOptions in initState as well as didChangeAppLifecycleState.
PlaytimeOptions options = new PlaytimeOptions()
..userId = 'user_id'
..sdkHash = 'YOUR_SDK_HASH'
..applicationProcessName = 'io.adjoe.FlutterTestApp'
..params = (new PlaytimeParams()
..uaNetwork = 'The user acquisition network'
..uaChannel = 'The user acquisition channel.'
..uaSubPublisherCleartext = 'The user acquisition publisher cleartext'
..uaSubPublisherEncrypted = 'The user acquisition publisher encrypted'
..placement = 'The offerwall placement')
..promotionTag = 'promotion-id'
..userProfile = (new PlaytimeUserProfile()
..birthday = birthday
..gender = gender)
..extensions = (new PlaytimeExtensions()
..subId1 = 'subId1'
..subId2 = 'subId2'
..subId3 = 'subId3'
..subId4 = 'subId3'
..subId5 = 'subId4');
void showCatalogWithOptions() {
Playtime.showCatalogWithOptions(options).then((_) {
print("showCatalogWithOptions Finished Successfully");
}, onError: (err) {
print('showCatalogWithOptions failed: $err');
});
}
} Using setPlaytimeOptions
setPlaytimeOptions(PlaytimeOptions options) → Future<void>Using getStatus to showCatalog
void showAdjoeCatalog() {
// Get current SDK status
final status = Playtime.getStatus();
print('ADJOE - Current SDK Status: $status');
if (status.isInitialized) {
try {
// Show catalog with options
Playtime.showCatalogWithOptions(
userId: 'your_user_id',
sdkHash: 'your_sdk_hash',
params: {
'uaNetwork': 'tiktok',
'uaChannel': 'video',
'uaSubPublisherCleartext': 'uaSubPublisherCleartext',
'uaSubPublisherEncrypted': 'uaSubPublisherEncrypted',
'placement': 'Main Screen',
'promotionTag': 'promotion-id',
},
extensions: {
'subId1': 'Target Group 1',
'subId2': 'Target Group 2',
},
);
} catch (e) {
print('ADJOE - Error launching catalog: $e');
}
} else {
print(
'ADJOE - SDK is not initialized yet. Please try again in a moment.');
}
}Parameters
Parameter
Explanation
App Tracking (iOS Only)
Last updated
