Update Guide

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.

Below we explain any extra steps necessary when updating to specific versions of the Tapjoy SDK.

14.0.0

  • Please replace use of depreacted method [Tapjoy trackPurchase] with trackPurchaseWithCurrencyCode:(NSString *)currencyCode price:(double)price.

13.4.0

We added a new connectWarning callback. This will fire when there is a non-blocking issue during connect, connectSuccess will also fire after. Currently this feature will only detect issues with UserId when sent in ConnectFlags.

Objective-C
Swift
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(tjcConnectWarning:) name:TJC_CONNECT_WARNING object:nil];

- (void)tjcConnectWarning:(NSNotification *)notifyObj 
{
    NSError *error = notifyObj.userInfo[TJC_CONNECT_USER_INFO_ERROR];
    NSError *underlyingError = error.userInfo[NSUnderlyingErrorKey];
}


13.2.0

Connect

We added error code & message parameters to connectFailure callback. The previous callback is now deprecated but still functional.

Objective-C
Swift
NSError *error = notifyObj.userInfo[TJC_CONNECT_USER_INFO_ERROR];
NSInteger code = error.code;
NSString *message = error.localizedDescription;
NSString *underlyingErrorMessage = underlyingError != nil ? [NSString stringWithFormat:@" - %li %@", underlyingError.code, underlyingError.localizedDescription] : @""; 

Max User Level

It's now possible to set the number of levels in your game. It can be set before or after connect.

Objective-C
Swift
[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.

Objective-C
Swift
[Tapjoy setUserSegment:TJSegmentVIP];
[Tapjoy setUserSegment:TJSegmentPayer];
[Tapjoy setUserSegment:TJSegmentNonPayer];
[Tapjoy setUserSegment:TJSegmentUnknown]; 

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.

Objective-C
Swift
TJPlacement *placement = [TJPlacement placementWithName:@"myPlacement" delegate:nil];
[placement setEntryPoint:TJEntryPointMainMenu];
[placement requestContent]; 

// Values available
TJEntryPointUnknown //Not set, but removes any value that was already set
TJEntryPointOther
TJEntryPointMainMenu
TJEntryPointHud
TJEntryPointExit
TJEntryPointFail
TJEntryPointComplete
TJEntryPointInbox 
TJEntryPointInitialisation
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 now set the users balance before creating a placement. It must be set before requestContent.

Objective-C
Swift
TJPlacement* placement = [TJPlacement placementWithName:@"placementName" delegate:nil];
[placement setBalance:100 forCurrencyId:@"1234" withCompletion:^(NSError * _Nullable error) {
    if (error != nil) {
        //Failure
        NSString *message = error.localizedDescription;
    } else {
        //Success
    }
}]; 

You can also set the amount of currency a user needs to achieve their goal on each placement.

Objective-C
Swift
TJPlacement* placement = [TJPlacement placementWithName:@"placementName" delegate:nil];
placement setRequiredAmount:100 forCurrencyId:@"1234" withCompletion:^(NSError * _Nullable error) {
    if (error != nil) {
        //Failure
        NSString *message = error.localizedDescription;
    } else {
        //Success
    }
} 

12.8.0

The Tapjoy SDK now uses XCFramework and no longer requires a separate resources bundle. Before adding Tapjoy.xcframework, delete Tapjoy.framework and TapjoyResources.bundle.