Advanced

TapdaqDelegate - Configuration methods

Loaded Tapdaq config

Called immediately after the SDK is ready to begin loading adverts.

Objective-C
Swift
- (void)didLoadConfig;

Tapdaq config failed to load

If the Tapdaq SDK is unable to initialise correctly, this method will be called.

Objective-C
Swift
- (void)didFailToLoadConfigWithError:(TDError *)error;

TapdaqDelegate - Banner methods

Loaded a banner ad

Called immediately after the banner is loaded.

Objective-C
Swift
- (void)didLoadBanner;

Failed to load a banner ad

Called when, for whatever reason, the banner was not able to be loaded.

Objective-C
Swift
- (void)didFailToLoadBanner;

User clicked a banner

Called when the user clicks the banner.

Objective-C
Swift
- (void)didClickBanner;

Network loads another banner in the UIView

Called when the ad within the banner view loads another ad.

Objective-C
Swift
- (void)didRefreshBanner;

TapdaqDelegate - Native ad methods

Loaded native ad

Called when a native advert is successfully loaded.

Objective-C
Swift
- (void)didLoadNativeAdvertForPlacementTag:(NSString *)tag
                                    adType:(TDNativeAdType)nativeAdType;

Failed to load native ad

Called when the native ad failed to load.

Objective-C
Swift
- (void)didFailToLoadNativeAdvertForPlacementTag:(NSString *)tag
                                          adType:(TDNativeAdType)nativeAdType;

TapdaqDelegate - More apps methods

Loaded content for the more apps popup

Called immediately when content for the more apps popup is available to be presented to the user.

Objective-C
Swift
- (void)didLoadMoreApps;

Failed to load content for the more apps popup

Called when, for whatever reason, the more apps popup was not able to be loaded.

Objective-C
Swift
- (void)didFailToLoadMoreApps;

About to display the more apps popup

Called immediately before the more apps popup is to be displayed to the user.

Objective-C
Swift
- (void)willDisplayMoreApps;

Displayed the more app popup

Called immediately after the more apps popup is displayed to the user.

Objective-C
Swift
- (void)didDisplayMoreApps;

Closed the more apps popup

Called when the user closes the more apps popup.

Objective-C
Swift
- (void)didCloseMoreApps;

TDAdRequestDelegate methods

Implementing this protocol allows listening to loading events from ads.

Loaded an ad

Called immediately after an ad has been successfully loaded.

Objective-C
Swift
- (void)didLoadAdRequest:(TDAdRequest * _Nonnull)adRequest;

Failed to load an ad

Called when the ad was not able to be loaded.

Objective-C
Swift
- (void)adRequest:(TDAdRequest * _Nonnull)adRequest didFailToLoadWithError:(TDError * _Nullable)error;

TDDisplayableAdRequestDelegate methods

Implementing this protocol allows listening to presentation events from ads. This protocol also conforms to TDAdRequestDelegate.

Note: Not all ad types support this delegate. Supported types are: static interstitial, video interstitial, rewarded video, offerwall.

About to display an ad

Called immediately before the ad is to be displayed to the user.

Objective-C
Swift
- (void)willDisplayAdRequest:(TDAdRequest * _Nonnull)adRequest;

Ad is shown to the user

Called immediately after the ad is displayed to the user

Objective-C
Swift
- (void)didDisplayAdRequest:(TDAdRequest * _Nonnull)adRequest;

Fail to Display an advert

Called after show when ad is unavailable or unable to display.

Objective-C
Swift
- (void)adRequest:(TDAdRequest *)adRequest didFailToDisplayWithError:(TDError *)error;

Ad is closed

Called when the user closes the ad.

Objective-C
Swift
- (void)didCloseAdRequest:(TDAdRequest * _Nonnull)adRequest;

TDClickableAdRequestDelegate methods

Implementing this protocol allows listening to click events from ads. This protocol also conforms to TDAdRequestDelegate.

Note: Not all ad types support this delegate. Supported types are: static interstitial, video interstitial, rewarded video, banner.

User clicked the ad

Called when the user clicks the ad.

Objective-C
Swift
- (void)didClickAdRequest:(TDAdRequest * _Nonnull)adRequest;

TDRewardedVideoAdRequestDelegate methods

Implementing this protocol allows listening to reward related events from rewarded ad requests. This protocol also conforms to TDAdRequestDelegate.

Note: Not all ad types support this delegate. Supported types are: rewarded video.

Received a reward for the user

Called when a reward is ready for the user.

Objective-C
Swift
- (void)adRequest:(TDAdRequest *)adRequest didValidateReward:(TDReward *)reward;

Failed to give a reward to the user

Called if an error occurred when rewarding the user.

Objective-C
Swift
- (void)didFailToValidateRewardAdRequest:(TDAdRequest *)adRequest;

TDOfferwallAdRequestDelegate methods

Implementing this protocol allows listening to offerwall related events from ad requests. This protocol also conforms to TDAdRequestDelegate.

Note: Not all ad types support this delegate. Supported types are: offerwall.

Received a offer credits for the user

Called when offer credits are ready for the user.

Objective-C
Swift
- (void)adRequest:(TDAdRequest * _Nonnull)adRequest didReceiveOfferwallCredits:(NSDictionary * _Nullable)creditInfo;

Failed to receive offer credits to the user

Called if an error occurred whilst the user completed the offer.

Objective-C
Swift
- (void)didFailToReceiveOfferwallCreditsAdRequest:(TDAdRequest * _Nonnull)adRequest;

Reward Id

The Reward Id is used for server-side callbacks, you can also retrieve it based on placement tags in the SDK like so:

Objective-C
Swift
[[Tapdaq sharedSession] rewardIdForPlacementTag:@"YOUR_PLACEMENT_TAG"];

Rewarded Video User Id

For server side callbacks, a Hashed User Id can be passed into the -showRewardedVideoForPlacementTag:hashedUserId: method, this will then be added to our server side callback to identify users.

NOTE: The String should be hashed before passed to Tapdaq SDK.

Objective-C
Swift
[[Tapdaq sharedSession] showRewardedVideoForPlacementTag:@"YOUR_PLACEMENT_TAG" hashedUserId:@"HASHED_USER_ID"];

In App Purchase Tracking

Tapdaq & AppLovin can track your users In App Purchases, to pass the data do the following:

Objective-C
Swift
NSString *itemName = @"";
double itemPrice = 0.0;
NSString *currency = @"GBP"; //3 Character currency code
NSString *locale; //Retreive from device e.g. en_GB

NSString *storeTransactionId; // Retrieve identifier from your SKPaymentTransaction
NSString *storeProductId; //Retrieve productIdentifier from your SKProduct

[[Tapdaq sharedSession] trackPurchaseForProductName:itemName
                                             price:itemPrice
                                       priceLocale:locale
                                          currency:currency
                                     transactionId:storeTransactionId
                                         productId:storeProductId;

AdMob Targeting

As of Tapdaq SDK 7.0.0, an AdMob content rating will be forwarded for every ad request to AdMob, to do this, set the value in the config either before Tapdaq has initialised or after like so:

Objective-C
Swift
// Before Tapdaq initialises
TDProperties *tapdaqProps = [[TDProperties alloc] init];

tapdaqProps.adMobContentRating = @"MA"// G, PG, T, MA
tapdaqProps.isAgeRestrictedUser = YES; // GDPR/COPPA

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

// After Tapdaq initialises
Tapdaq.sharedSession.adMobContentRating = @"MA"; // G, PG, T, MA
Tapdaq.sharedSession.isAgeRestrictedUser = YES; // GDPR/COPPA

The tag_for_under_age_of_consent flag will be sent to AdMob if the user is subject to GDPR and AgeRestrictedUser is set. The ChildDirectedTreatment COPPA flag will be sent if user is not known to be subject to GDPR and AgeRestrictedUser is set. Read more about AdMob Targeting here.