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.
[Tapjoy trackPurchase]
with trackPurchaseWithCurrencyCode:(NSString *)currencyCode price:(double)price
.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];
}
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] : @"";
It's now possible to set the number of levels in your game. It can be set before or after connect.
[Tapjoy setMaxLevel:10];
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];
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
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
}
}];
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
}
}