Documentation

Support

Quickstart

Import the Tapjoy Unity plugin package into your project, configure SDK keys, and add the Tapjoy GameObject to your first scene to begin integration.
Read time 2 minutesLast updated 3 hours ago

Minimum Requirements

  • React Native: 0.71.6
  • Node 14 or newer
  • Ruby 2.7.6
  • iOS: 13.0
  • Android: 5.0 (API 21)

SDK Integration

The first step in integrating with your app is to install the Tapjoy React Native Plugin. We support NPM and Yarn.

NPM

When using NPM you need to add our Maven repository to your Android App or Project level build.gradle file.
repositories {
    maven {
        url "https://sdk.tapjoy.com/"
    }
}
Then you can install the plugin.
npm install tapjoy-react-native-sdk

Yarn

yarn add tapjoy-react-native-sdk
You can then import Tapjoy into your application to use the plugin:
import {Tapjoy, TJPlacement} from 'tapjoy-react-native-sdk'

Add App Permissions (for Android)

The
ACCESS_WIFI_STATE
permission can optionally be included in your manifest:
<manifest ...>
  ...
  <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
  ...
</manifest>

Connect to Tapjoy

The connect call is how we initialise the the Offerwall SDK. Do this as soon as possible after your app launches
try {
  let sdkKey = Platform.OS === 'ios' ? 'ios-sdk-key' : 'android-sdk-key'
  let flags: object = { TJC_OPTION_USER_ID: 'userId' };
  await Tapjoy.connect(sdkKey, flags, (event: TapjoyEvent) => {
       // Handle Warning
     },
  );

  // Handle Success
} catch (error: any) {
  // Handle Failure
}
A warning will occur when there is a non-blocking issue during connect. Success will occur after. Currently this feature will only detect issues with UserId when sent in ConnectFlags. When you have finished configuing Tapjoy you can build and run your application.

Logging

You can get and set the logging level by using the following methods.
// Set logging level
Tapjoy.setLoggingLevel(TJLoggingLevel.Debug);

// Get logging level
var loggingLevel = await Tapjoy.getLoggingLevel();

Max User Level

You can tell Tapjoy how many levels there are in your game. You can set this value before or after calling connect.
Tapjoy.setMaxLevel(10); 

User Segment

You can identify users as part of a segment by calling
setUserSegment
. This can be set before or after calling connect.
Tapjoy.setUserSegment(TJSegment.VIP);
Tapjoy.setUserSegment(TJSegment.Payer);
Tapjoy.setUserSegment(TJSegment.NonPayer);
Tapjoy.setUserSegment(TJSegment.Unknown);

Request App Tracking Transparency authorization

If your application is designed to use App Tracking Transparency, to display the dialog to request permission for accessing the IDFA, update your Info.plist by including the NSUserTrackingUsageDescription key along with a custom message to describe this permission to use IDFA in your application. Next install the
react-native-tracking-transparency
package:
yarn add react-native-tracking-transparency
Import the library, and then show the permission dialog:
import {
    getTrackingStatus,
    requestTrackingPermission,
} from 'react-native-tracking-transparency';

...

let trackingStatus = await getTrackingStatus();
if (trackingStatus === 'authorized' || trackingStatus === 'unavailable') {
    await Tapjoy.connect(sdkKey, flags);
}else{
    trackingStatus = await requestTrackingPermission();
    await Tapjoy.connect(sdkKey, flags);
}