Import <appmediation/AMSDK.h>
in your AppDelegate.m class and call SDK initialization method :
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[AMSDK initWithAppKey:@"your_app_key"];
}
Here is how you can integrate an interstitial into your app just in few steps;
- Import AMInterstitial on top of your class file:
#import<appmediation/AMInterstitial.h>
- Set your class to conform
AMInterstitialDelegate
:
@interface YourClass () <AMInterstitialDelegate>
//code
@end
- Initialize and load the AMInterstitial instance :
self.interstitial = [[AMInterstitial alloc] init];
self.interstitial.delegate = self; // Optional
[self.interstitial load];
- Show when it's loaded :
if ([self.interstitial isReady]) {
[self.interstitial presentFromViewController:self];
}
- (Optional) If you want to have a complete control over AMInterstitial instance, you can implement delegate functions below :
-(void)AMInterstitialDidLoad:(AMInterstitial *)interstitial;
-(void)AMInterstitialDidFailToLoad:(AMInterstitial *)interstitial withError:(NSError *)error;
-(void)AMInterstitialDidShow:(AMInterstitial *)interstitial;
-(void)AMInterstitialDidClick:(AMInterstitial *)interstitial;
-(void)AMInterstitialDidClose:(AMInterstitial *)interstitial;
Here is how you can integrate a rewarded video into your app just in few steps;
- Import AMRewarded on top of your class file:
#import<appmediation/AMRewarded.h>
- Set your class to conform
AMRewardedDelegate
:
@interface YourClass () <AMRewardedDelegate>
//code
@end
- Initialize and load the AMRewarded instance :
self.rewarded = [[AMRewarded alloc] init];
self.rewarded.delegate = self; // Optional
[self.rewarded load];
- Show when it's loaded :
if ([self.rewarded isReady]) {
[self.rewarded presentFromViewController:self];
}
- (Optional) If you want to have a complete control over AMRewarded instance, you can implement delegate functions below :
-(void)AMRewardedDidLoad:(AMRewarded *)rewarded;
-(void)AMRewardedDidFailToLoad:(AMRewarded *)rewarded withError:(NSError *)error;
-(void)AMRewardedDidShow:(AMRewarded *)rewarded;
-(void)AMRewardedDidClick:(AMRewarded *)rewarded;
-(void)AMRewardedDidClose:(AMRewarded *)rewarded;
-(void)AMRewardedDidComplete:(AMRewarded *)rewarded withReward:(NSString *)name andAmount:(NSString *)amount;
Here is how you can integrate a banner into your app just in few steps;
- Import AMBanner on top of your class file:
#import<appmediation/AMBanner.h>
- Set your class to conform
AMBannerDelegate
:
@interface YourClass () <AMBannerDelegate>
//code
@end
- Initialize and load AMBanner instance :
```objc
self.banner = [[AMBanner alloc] initWithSize:AMBanner_320x50 andPosition:Bottom];
//You can also use custom position, please refer to AMBanner header documentation.
self.banner.delegate = self; // Optional
[self.view addSubview:self.banner];
[self.banner load];
```
- To remove banner instance :
[self.banner remove];
- (Optional) If you want to have a complete control over AMBanner instance, you can implement delegate functions below :
-(void)AMBannerDidLoad:(AMRewarded *)banner;
-(void)AMBannerDidFailToLoad:(AMRewarded *)banner withError:(NSError *)error;
-(void)AMBannerDidShow:(AMRewarded *)banner;
-(void)AMBannerDidClick:(AMRewarded *)banner;
Please set these features before SDK initialization.
-
Test Mode
If you are testing your SDK integration, please set this value to display test ads and %100 fill. By default it is set to NO.
[AMSDK setTestMode:YES];
-
Logging
Appmediation SDK supports 3 level of logging :
- AMLogError : Only logs error messages. Set by default.
- AMLogInfo : Logs information about setup.
- AMLogDebug : Logs helpful information to debug.
[AMSDK setLogLevel:AMLogDebug];
-
Audience Targeting
If you want to target specific audiences, you can set values below :
3.1 Age
[AMSDK setAge:20];
3.2 Gender
[AMSDK setGender:AppmediationUserGenderFemale];
3.3 Language
[AMSDK setLanguage:@"Chinese"];
3.4 Keywords
[AMSDK setKeywords:@"cars,technology"];