pod 'IronSourceTapjoyAdapter','4.1.23.1'
You can find the latest adapter version here.
#import <Tapjoy/TJPlacement.h>
[Tapjoy connect:@"TJ_SDK_KEY"];
- (void)tjcConnectSuccess:(NSNotification *)notifyObj
{
NSLog(@"Tapjoy connect succeeded");
}
- (void)tjcConnectFail:(NSNotification *)notifyObj
{
NSLog(@"Tapjoy connect failed");
}
TJPlacement *placement = [TJPlacement placementWithName:@"Offerwall" delegate:self];
[p requestContent];
- (void)requestDidSucceed:(TJPlacement*)placement{}
- (void)requestDidFail:(TJPlacement*)placement error:(NSError*)error{}
- (void)contentIsReady:(TJPlacement*)placement{}
- (void)contentDidAppear:(TJPlacement*)placement{}
- (void)contentDidDisappear:(TJPlacement*)placement{}
Some of these can replace the ironSource callbacks you may have already implemented. You can see the corresponding callbacks in the table below so that you can easily move any custom logic into the appropriate Tapjoy callbacks:
ironSource Callback | Tapjoy Callback |
---|---|
offerwallDidShow | contentDidAppear |
offerwallDidClose | contentDidDisappear |
offerwallHasChangedAvailability | contentIsReady |
requestDidSuceed
will be called when the content request returns from Tapjoy’s servers. contentIsReady
will be called when the content (Offerwall) is ready to display. At this point you can either display Offerwall, or set some flag so that you know it is ready to display when you need it.
if (placement.isContentReady) {
[placement showContentWithViewController:nil];
}
This will replace your existing ironSource call:
[IronSource showOfferwallWithViewController:UIViewController];
The showContent
method takes a view controller argument. We recommend you pass nil and allow Tapjoy to create a view controller for you. In most cases this is the safest option. If you have a complex view hierarchy and for some reason want to manage the display yourself it is vitally important that the ViewController passed to this method be the top-most view and that it be unobstructed by other views, and that other views are not placed on top of this view until after the Tapjoy content has been dismissed.
Once the user has dismissed the Offerwall you must request the content again. You cannot show a placement multiple times. We would recommend that you request the placement in the contentDidDisappear
callback so that it is ready to display again the next time a user requests it.
You can now remove any remaining ironSource Offerwall code. For example:
[IronSource setOfferwallDelegate:yourOfferwallDelegate];
Also any callbacks that you did not convert to an equivalent Tapjoy version. If you specify @[IS_OFFERWALL]
when initialising the ironSource SDK, you can also remove this argument.
If you are using ironSource LevelPlay, you may use LevelPlay APIs to share with Tapjoy the following privacy flags:
If you are not using ironSource LevelPlay or if you would like to configure Tapjoy's SDK separately, please follow these guidelines to share with Tapjoy the relevant privacy flags.