Documentation

Support

Update Guide

Update your Tapjoy Offerwall iOS SDK version properly to avoid issues and maintain compatibility.
Read time 3 minutesLast updated 3 hours ago

This guide describes steps required when updating from one Offerwall 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 Offerwall SDK.

14.3.0

  • Replace any use of
    [Tapjoy setDebugEnabled:YES]
    with
    [Tapjoy setLoggingLevel:TJLoggerLevelDebug]
    . The former has been deprecated.
  • Log levels are: Error, Warning, Info and Debug.
  • Replace any use of
    TJC_OPTION_ENABLE_LOGGING
    with
    TJC_OPTION_LOGGING_LEVEL
    . The former has been deprecated.

14.2.0

  • Remove any use of the deprecated TJPlacement didClick callback. It will be removed in the next major version and no longer does anything.
  • Remove any use of the deprecated getSupportURL method. It will be removed in the next major version and no longer does anything.

14.0.0

  • 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.
[[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];
}
NotificationCenter.default.addObserver(self, selector: #selector(AppDelegate.tjcConnectWarning(notif:)), name: NSNotification.Name(rawValue: TJC_CONNECT_WARNING), object: nil)

@objc func tjcConnectWarning(notif: NSNotification) {
    var message = "Tapjoy Connect Warning"
    if let error = notif.userInfo?[TJC_CONNECT_USER_INFO_ERROR] as? NSError {
        message.append("\nError: \(error.code) - \(error.localizedDescription)")
        if let underlyingError = error.userInfo[NSUnderlyingErrorKey] as? NSError {
            message.append("\nUnderlying Error: \(underlyingError.code) - \(underlyingError.localizedDescription)")
        }
    }
}

13.2.0

Connect

We added error code & message parameters to
connectFailure
callback. The previous callback is now deprecated but still functional.
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] : @""; 
if let error = notif.userInfo?[TJC_CONNECT_USER_INFO_ERROR] as? NSError {
    let code = error.code
    let message = error.localizedDescription
    if let underlyingError = error.userInfo[NSUnderlyingErrorKey] as? NSError {
        let underlyingErrorMessage = "\nUnderlying Error: \(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.
[Tapjoy setMaxLevel:10]; 
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:TJSegmentVIP];
[Tapjoy setUserSegment:TJSegmentPayer];
[Tapjoy setUserSegment:TJSegmentNonPayer];
[Tapjoy setUserSegment:TJSegmentUnknown]; 
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.
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 
let placement = TJPlacement(name: "myPlacement", delegate: nil)
placement?.entryPoint = TJEntryPoint.mainMenu
placement?.requestContent() 

// Values available
TJEntryPoint.unknown
TJEntryPoint.other
TJEntryPoint.mainMenu
TJEntryPoint.hud
TJEntryPoint.exit
TJEntryPoint.fail
TJEntryPoint.complete
TJEntryPoint.inbox
TJEntryPoint.initialisation
TJEntryPoint.store

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.
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
    }
}]; 
let placement = TJPlacement(name: "placementName", delegate: nil)
placement?.setBalance(100, forCurrencyId: "1234", withCompletion: { error in
    if let error = error {
        //Failure
        let message = error.localizedDescription
    } else {
        //Success
    }
}) 
You can also set the amount of currency a user needs to achieve their goal on each placement.
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
    }
} 
let placement = TJPlacement(name: "placementName", delegate: nil)
placement?.setRequiredAmount(100, forCurrencyId: "1234", withCompletion: { error in
    if let error = error {
        //Failure
        let message = error.localizedDescription
    } else {
        //Success
    }
}) 

12.8.0

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