tap_joy_plugin

Creator: coderz1093

Last updated:

0 purchases

TODO
Add to Cart

Description:

tap joy plugin

tap_joy_plugin #
Flutter Plugin for TapJoy SDK - Supports Android & iOS
This Plugin Does NOT Support TapJoy purchases or Push Notifications yet.
Medium Article on how to implement the plugin
info.plist changes #
TapJoy is enrolled as a network partner in Apple’s SKAdNetwork. Add Tapjoy's network ID to your app’s info.plist file along with the IDs of the DSP partners listed below:
<key>SKAdNetworkItems</key>
<array>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>ecpz2srf59.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>7ug5zh24hu.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>9t245vhmpl.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>prcb7njmu6.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>5lm9lj6jb7.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>578prtvx9j.skadnetwork</string>
</dict>
</array>
copied to clipboard
iOS 14.0 or higher required App Tracking Authorization from the user.
add the following lines to info.plist file.
<key>NSUserTrackingUsageDescription</key>
<string>This allows us to deliver personalized ads for you.</string>
copied to clipboard
Podfile changes #
Comment out the following line in your iOS Podfile
target 'Runner' do
# use_frameworks!
use_modular_headers!
copied to clipboard
AndroidManifest changes #
The following permissions are needed:

INTERNET
ACCESS_NETWORK_STATE
ACCESS_WIFI_STATE (optional)

add the following permissions to your AndroidManifest.xml file:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
copied to clipboard
add the following activities to the AndroidManifest.xml file in the Application block:
<activity
android:name="com.tapjoy.TJAdUnitActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:hardwareAccelerated="true"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity
android:name="com.tapjoy.TJContentActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:hardwareAccelerated="true" />
copied to clipboard
As part of your Google Play Services integration, you will have to add the following:
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
copied to clipboard
Usage #
Connect to TapJoy #
TapJoyPlugin.shared.connect(androidApiKey: “your-tapjoy-android-key”,
iOSApiKey:"your-tapjoy-iOS-key",debug: true);
copied to clipboard
Set Connection Result handler #
TapJoyPlugin.shared.setConnectionResultHandler((result) {
switch (result) {
case TJConnectionResult.connected:
// TODO: Handle this case.
break;
case TJConnectionResult.disconnected:
// TODO: Handle this case.
break;
}

});
copied to clipboard
Get iOS App Tracking Authorization #
TapJoyPlugin.shared.getIOSATTAuth().then((value) {
switch(value) {

case IOSATTAuthResult.notDetermined:
// TODO: Handle this case.
break;
case IOSATTAuthResult.restricted:
// TODO: Handle this case.
break;
case IOSATTAuthResult.denied:
// TODO: Handle this case.
break;
case IOSATTAuthResult.authorized:
// TODO: Handle this case.
break;
case IOSATTAuthResult.none:
// TODO: Handle this case.
break;
case IOSATTAuthResult.iOSVersionNotSupported:
// TODO: Handle this case.
break;
case IOSATTAuthResult.android:
// TODO: Handle this case.
}
});
copied to clipboard
Set User ID #
TapJoyPlugin.shared.setUserID(userID: "user_id");

copied to clipboard
Create Placement #
TJPlacement placement = TJPlacement(name: "TapJoyPlacementName");

copied to clipboard
Create and set handler for placement #
TJPlacementHandler handler = (contentState,name,error) {
switch(contentState) {
case TJContentState.contentReady:
// TODO: Handle this case.
break;
case TJContentState.contentDidAppear:
// TODO: Handle this case.
break;
case TJContentState.contentDidDisappear:
// TODO: Handle this case.
break;
case TJContentState.contentRequestSuccess:
// TODO: Handle this case.
break;
case TJContentState.contentRequestFail:
// TODO: Handle this case.
break;
case TJContentState.userClickedAndroidOnly:
// TODO: Handle this case.
break;
}
};



placement.setHandler(handler);
copied to clipboard
Request Content #
await placement.requestContent();
copied to clipboard
Show Placement Content #
await placement.showPlacement();
copied to clipboard
Set Currency Balance Response Handler #
TapJoyPlugin.shared.setGetCurrencyBalanceHandler((currencyName,
amount, error) { });

copied to clipboard
Get User Balance #
await TapJoyPlugin.shared.getCurrencyBalance();
copied to clipboard
Set Award currency response handler #
TapJoyPlugin.shared.setAwardCurrencyHandler((currencyName,
amount, error) { });
copied to clipboard
Award Currency #
TapJoyPlugin.shared.awardCurrency(int amount);
copied to clipboard
Set Spend Currency response handler #
TapJoyPlugin.shared.setSpendCurrencyHandler((currencyName,
amount, error) { });
copied to clipboard
Spend Currency #
TapJoyPlugin.shared.spendCurrency( int amount );
copied to clipboard
Contributing #
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
License #
BSD

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.