Update Guide
Follow the Unity Update Guide to safely upgrade between Tapjoy SDK versions by removing deprecated methods and adopting updated alternatives to prevent integration issues.
Read time 2 minutesLast updated 3 hours ago
This guide describes steps required when updating from one Tapjoy SDK version to another, it's recommended you perform all the steps to prevent any issues or conflicts.
14.3.0
We have modified how the connect call works in this version. Previously it looked like this:From 14.3.0, connect similar to the following example: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); } catch (error: any) { let errorString = `Tapjoy SDK failed to connect. code: ${error.code}, message: ${error.message}`; }
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 }
13.4.0
We added a newconnectWarning
connectSuccess
We also added support for User Tags.import { NativeEventEmitter, NativeModules, } from 'react-native'; const TJ = NativeModules.TapjoyReactNativeSdk; const TapjoyEmitter = new NativeEventEmitter(TJ); const TapjoyEventType = 'Tapjoy'; const subscription = TapjoyEmitter.addListener( TapjoyEventType, (event: TapjoyEvent) => { if (event.name === TJConnect.TJC_CONNECT_WARNING) { subscription.remove(); setStatusLabelText( `Tapjoy SDK connected with Warning: ErrorCode: ${event.code} ${event.message} ` ); } } );
Tapjoy.addUserTag(''); Tapjoy.removeUserTag(''); Tapjoy.clearUserTags();
13.2.0
Connect
We added error code & message parameters to connectFailure callback. The previous callback is now deprecated but still functional.try { await Tapjoy.connect(sdkKey, flags); } catch (error: any) { let errorString = `Tapjoy SDK failed to connect. code: ${error.code}, message: ${error.message}`; }
Max User Level
It's now possible to set the number of levels in your game. It can be set before or after connect.Tapjoy.setMaxLevel(10);
User Segment
You can now set the type of user currently using your app. This can be set before or after connect, or during the session.Tapjoy.setUserSegment(TJSegment.VIP); Tapjoy.setUserSegment(TJSegment.Payer); Tapjoy.setUserSegment(TJSegment.NonPayer); Tapjoy.setUserSegment(TJSegment.Unknown);
Entry Point
Before calling request connect you can set the entry point. This describes where in the app the placement will be shown. You can choose from one of several preset values.let placement = new TJPlacement("myPlacement"); placement.setEntryPoint(TJEntryPoint.TJEntryPointMainMenu); placement.requestContent(); // Available values TJEntryPointUnknown TJEntryPointOther TJEntryPointMainMenu TJEntryPointHud TJEntryPointExit TJEntryPointFail TJEntryPointComplete TJEntryPointInbox TJEntryPointInit TJEntryPointStore
Currency
- Get/spend/earn will no longer accept negative values.
- If self-managed currencies call the managed currency API's, an error will be returned.
You can also set the amount of currency a user needs to achieve their goal on each placement.let placement = new TJPlacement('placementName'); try { await placement?.setCurrencyBalance('1234', 100); } catch (e: any) { let code = e.code; let message = e.message; }
let placement = new TJPlacement('placementName'); try { await offerwallPlacement?.setRequiredAmount(100, '100'); } catch (e: any) { let code = e.code; let message = e.message; }
User Privacy
Updated interface to match the other platforms. Also added support for AndroidoptOutAdvertisingId
let privacyPolicy = new TJPrivacyPolicy(); privacyPolicy.setSubjectToGDPRStatus(TJStatus.True); privacyPolicy.setBelowConsentAgeStatus(TJStatus.False); privacyPolicy.setUserConsentStatus(TJStatus.Unknown); privacyPolicy.setUSPrivacy('1---'); privacyPolicy.optOutAdvertisingID(false);