More Apps Cross Promotion

The More Apps unit presents a list of your promoted applications to your users in the form of a popup.

Each position in the more apps template has it’s own custom placement tag. This enables you to control exactly which apps are shown in each position within the unit.

To learn how to set up the more apps popup on the Tapdaq dashboard, visit the following guide.

NEW: SDK version 7.0.0 supports zones. Please note, this release does not currently support cross promotion ad serving. To access our cross promotion features, please use SDK version 6.4.1

1. Register the placement tags

To begin preparations for displaying a more apps popup, go back to your AppDelegate.m/AppDelegate.swift where you had setup the Tapdaq SDK, and add modify it to look like this:

Adding a backfill tag will populate the bottom of your list with backfill items setup in the dashboard, to use this add tray-position-backfill to your registered placements.

Objective-C
Swift
TDProperties *properties = [[TDProperties alloc] init];

TDPlacement *trayPosition1 = [[TDPlacement alloc] initWithAdTypes:TDAdType1x1Medium forTag:@"tray-position-1"];
TDPlacement *trayPosition2 = [[TDPlacement alloc] initWithAdTypes:TDAdType1x1Medium forTag:@"tray-position-2"];
TDPlacement *trayPosition3 = [[TDPlacement alloc] initWithAdTypes:TDAdType1x1Medium forTag:@"tray-position-3"];
TDPlacement *trayPosition4 = [[TDPlacement alloc] initWithAdTypes:TDAdType1x1Medium forTag:@"tray-position-4"];
TDPlacement *trayPosition5 = [[TDPlacement alloc] initWithAdTypes:TDAdType1x1Medium forTag:@"tray-position-5"];
TDPlacement *trayPositionBackfill = [[TDPlacement alloc] initWithAdTypes:TDAdType1x1Medium forTag:@"tray-position-backfill"];

[properties registerPlacements:@[ trayPosition1, trayPosition2, trayPosition3, trayPosition4, trayPosition5, trayPositionBackfill ]];

[[Tapdaq sharedSession] setApplicationId:@"YOUR_APP_ID"
                               clientKey:@"YOUR_CLIENT_KEY"
                              properties:properties];

2. Load the content

Navigate to the header file that you want the more apps popup to appear in (e.g. MyViewController.h/ViewController.swift) and add the following import statement at the top of the file:

Objective-C
Swift
#import <Tapdaq/Tapdaq.h>

@interface MyViewController : UIViewController <TapdaqDelegate>

The above code imports Tapdaq to the class, and declares that we will conform to the TapdaqDelegate protocol.

Please note that you only need to provide import statement once per header file.

Next, add the following command to the implementation file (e.g. MyViewController.m/ViewController.swift):

Objective-C
Swift
- (void)viewDidLoad {
    [super viewDidLoad];
    [[Tapdaq sharedSession] setDelegate:self];
}

Once this is done, the Tapdaq delegate method -didLoadConfig becomes available, implement it like so:

Objective-C
Swift
- (void)didLoadConfig {
    [[Tapdaq sharedSession] loadMoreApps];
}

This delegate method is invoked when the Tapdaq SDK has finished loading it's config, and is ready to begin loading ads.

Note: Ads should only be requested once the Tapdaq delegate method -didLoadConfig has been called. This ensures Tapdaq is initialised and ready to begin loading ads. Requesting ads prior to Tapdaq initialising will result in failed ad requests

3. Display the more apps popup

Once that is done, implement the following:

Objective-C
Swift
- (void)didLoadMoreApps {
    [[Tapdaq sharedSession] showMoreApps];
}

The code above is executed when the content has successfully loaded. For a full list of more apps delegate methods we support, see our Advanced page.

It is also possible to check the more apps unit is loaded before displaying it to the user, as shown below:

Objective-C
Swift
if ([[Tapdaq sharedSession] isMoreAppsReady]) {
    [[Tapdaq sharedSession] showMoreApps];
}

4. Load more content on close

If you wish to load another rewarded video after you have shown one, implement the following:

Objective-C
Swift
- (void)didCloseMoreApps {
    [[Tapdaq sharedSession] loadMoreApps];
}

Build and run your application to test the advert displays correctly.

5. Customise the look and feel

Colours and text used in the more apps popup can be customised to make the design fit into your app. When loading the popup, you must pass in a TDMoreAppsConfig object with the settings you wish to change, here's an example:

Objective-C
Swift
TDMoreAppsConfig *moreAppsConfig = [[TDMoreAppsConfig alloc] init];

moreAppsConfig.headerText = @"More Games";
moreAppsConfig.installedAppButtonText = @"Play";

moreAppsConfig.headerTextColor = [UIColor whiteColor];
moreAppsConfig.headerColor = [UIColor darkGrayColor];
moreAppsConfig.headerCloseButtonColor = [UIColor blackColor];
moreAppsConfig.backgroundColor = [UIColor grayColor];

moreAppsConfig.appNameColor = [UIColor blackColor];
moreAppsConfig.appButtonColor = [UIColor blackColor];
moreAppsConfig.appButtonTextColor = [UIColor whiteColor];
moreAppsConfig.installedAppButtonColor = [UIColor whiteColor];
moreAppsConfig.installedAppButtonTextColor = [UIColor blackColor];

[[Tapdaq sharedSession] loadMoreAppsWithConfig:moreAppsConfig];

Need help?

If you are having any problems integrating, feel free to contact us on [email protected] and we will be more than happy to help.

What's next?

Now that you have successfully integrated a rewarded video into your app, what would you like to do next?