Skip to content

AdMob Mediation Support

Integrate SDK and Mediation Adapter

Swift Package Manager

To add a package dependency to your project, follow these steps:

1.In Xcode, install the Carty SDK Swift Package by navigating to File > Add Package Dependencies....

2.In the prompt that appears, search for the CartyAdmobAdapter Swift Package GitHub repository:

http
https://github.com/cartysdk/CartyAdmobAdapter-iOS.git

3.Select the version of the CartyAdmobAdapter Swift Package you want to use. For new projects, we recommend using the Up to Next Major Version.

4.Enable the -ObjC flag in Xcode: click on your project settings, go to Build Settings, search for Other Linker Flags and add -ObjC.

CocoaPods

To integrate the Carty SDK through CocoaPods:

1.Add the following line to your Podfile:

http
pod CartyAdmobAdapter

2.Run the following on the command line:

http
pod install --repo-update

Configure your Mediation Settings

1.Create a mediation

Click on the "Mediation" link on the side bar menu and Select "Create mediation group"

CreateGroup

2.Add Custom Event

In your Mediation Group under the Waterfall Panel, select "Add Custom Event"

AddEvent1

Fill in the relevant information and click Continue.

AddEvent2

Fill the "Class Name" and "Parameter" fields based on the table below and the Ad Type that you are looking to monetize.

Then Done.

AddEvent3

Supported Ad format

Ad TypeClass NameParameter
BannerCartyAdmobAdapter{"appid":"your-app-id","pid":"your-placement-id"}
NativeCartyAdmobAdapter{"appid":"your-app-id","pid":"your-placement-id"}
InterstitialCartyAdmobAdapter{"appid":"your-app-id","pid":"your-placement-id"}
Rewarded VideoCartyAdmobAdapter{"appid":"your-app-id","pid":"your-placement-id"}
AppOpenCartyAdmobAdapter{"appid":"your-app-id","pid":"your-placement-id"}

CustomExtras

Ad network extras sent to CartySDK when load ad

  • Objective-C
objc
#import "CartyCustomExtras.h"

GADRequest *request = [GADRequest request];
CartyCustomExtras *customExtras = [[CartyCustomExtras alloc] init];
//set userID
customExtras.userID = @"<user_id>";
//set doNotSell
customExtras.doNotSell = NO;
//set customRewardString (only for Rewarded Video)
customExtras.customRewardString = @"<custom_reward_string>";
//set Mute
customExtras.isMute = YES;
//set bannerSize (only for banner)
customExtras.bannerSize = CTBannerSizeType320x50;
[request registerAdNetworkExtras:customExtras];

//load with request 
[GADAd loadWithAdUnitID:@"<ad_unit_id>" request:request completionHandler:^(GADRewardedAd * _Nullable rewardedAd, NSError * _Nullable error) {
}];
  • Swift
swift
import CartyAdmobAdapter

let request = Request();
let customExtras = CartyCustomExtras()
//set userID
customExtras.userID = "<user_id>"
//set doNotSell
customExtras.doNotSell = true;
//set customRewardString (only Rewarded Video)
customExtras.customRewardString = "<custom_reward_string>"
//set Mute
customExtras.isMute = true;
//set bannerSize (only banner)
customExtras.bannerSize = CTBannerSizeType320x50;
request.register(customExtras)
 
//load with request    
ad.load(with: "<ad_unit_id>", request: request)