iOS Integration

Prerequisite

  • iOS15 requires Xcode 13+. Please make sure you are using the latest version of Xcode.
  • MAS supports iOS 10.0 and above

1. Open your Podfile

Add the following content: 

				
					source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/Yodo1Games/MAS-Spec.git'
source 'https://github.com/Yodo1Games/Yodo1Spec.git'

pod 'Yodo1MasFull', '4.4.0'
				
			


Execute the following command in Terminal:

				
					pod install --repo-update
				
			


2. Xcode Project Configuration

2.1 AppLovin SDK Key

  • Use the Xcode project navigator and select Info.plist.
  • Click on the add button (+) next to any key in the property list editor and create a new property key.
  • Enter the key name – AppLovinSdkKey.
  • Choose a string value type.
  • Enter xcGD2fy-GdmiZQapx_kUSy5SMKyLoXBk8RyB5u9MVv34KetGdbl4XrXvAUFy0Qg9scKyVTI0NM4i_yzdXih4XE in the value field.
				
					AppLovinSdkKey
xcGD2fy-GdmiZQapx_kUSy5SMKyLoXBk8RyB5u9MVv34KetGdbl4XrXvAUFy0Qg9scKyVTI0NM4i_yzdXih4XE
				
			


2.2 iOS9 App Transport Security (ATS) Settings

Apple has added in controls for ATS in iOS9. It’s important to make these changes to your info.plist to ensure uninterrupted ad delivery across all Mediation Networks.

  • Add a dictionary and name it NSAppTransportSecurity.
  • Add a Boolean named NSAllowsArbitraryLoads in this dictionary and set it to YES.

You may edit the info.plist file by using the Open As Source Code option and adding the following code:

				
					NSAppTransportSecurity 
    NSAllowsArbitraryLoads
				
			


2.3 iOS14 AppTrackingTransparency(ATT) Settings

User tracking instructions

iOS 14 requires publishers to obtain permission for tracking user devices across applications. Follow these steps to complete the process.

  • Use the Xcode project navigator and select Info.plist.
  • Click the add button (+) next to any key in the property list editor and create a new property key.
  • Enter the key name – NSUserTrackingUsageDescription.
  • Choose a string value type.
  • Enter the app tracking transparency message in the value field.
  • Personalized ads are delivered using this identifier:
				
					NSUserTrackingUsageDescription
This identifier will be used to deliver personalized ads to you.
				
			


For more information about NSUserTrackingUsageDescriptionthis developer documentation from apple

For multi-language localizations, check this developer documentation from Apple.

Advertising network ID

Games for users running iOS 14 or later need to include the network ID of each advertising platform in the attribute list file (Info.plist):

  • Use the Xcode project navigator and select Info.plist.
  • Click the add button (+) next to any key in the property list editor and create a new property key.
  • Enter the key name – SKAdNetworkItems.
  • For value type, choose Array.
  • Use the key and each advertising platform network ID string for adding the dictionary to the array.

For more information about editing the property list, check Xcode’s documentation.

The following shows the array of dictionaries you need to access the SDK.

				
					SKAdNetworkItems
SKAdNetworkIdentifier
275upjj5gd.skadnetwork
SKAdNetworkIdentifier
294l99pt4k.skadnetwork
SKAdNetworkIdentifier
2fnua5tdw4.skadnetwork
SKAdNetworkIdentifier
2u9pt9hc89.skadnetwork
SKAdNetworkIdentifier
3rd42ekr43.skadnetwork
SKAdNetworkIdentifier
4468km3ulz.skadnetwork
SKAdNetworkIdentifier
44jx6755aq.skadnetwork
SKAdNetworkIdentifier
44n7hlldy6.skadnetwork
SKAdNetworkIdentifier
4fzdc2evr5.skadnetwork
SKAdNetworkIdentifier
4pfyvq9l8r.skadnetwork
SKAdNetworkIdentifier
523jb4fst2.skadnetwork
SKAdNetworkIdentifier
5l3tpt7t6e.skadnetwork
SKAdNetworkIdentifier
5lm9lj6jb7.skadnetwork
SKAdNetworkIdentifier
6964rsfnh4.skadnetwork
SKAdNetworkIdentifier
6g9af3uyq4.skadnetwork
SKAdNetworkIdentifier
74b6s63p6l.skadnetwork
SKAdNetworkIdentifier
7rz58n8ntl.skadnetwork
SKAdNetworkIdentifier
7ug5zh24hu.skadnetwork
SKAdNetworkIdentifier
84993kbrcf.skadnetwork
SKAdNetworkIdentifier
8s468mfl3y.skadnetwork
SKAdNetworkIdentifier
9nlqeag3gk.skadnetwork
SKAdNetworkIdentifier
9rd848q2bz.skadnetwork
SKAdNetworkIdentifier
9t245vhmpl.skadnetwork
SKAdNetworkIdentifier
a7xqa6mtl2.skadnetwork
SKAdNetworkIdentifier
c6k4g5qg8m.skadnetwork
SKAdNetworkIdentifier
cg4yq2srnc.skadnetwork
SKAdNetworkIdentifier
cj5566h2ga.skadnetwork
SKAdNetworkIdentifier
e5fvkxwrpn.skadnetwork
SKAdNetworkIdentifier
ejvt5qm6ak.skadnetwork
SKAdNetworkIdentifier
g28c52eehv.skadnetwork
SKAdNetworkIdentifier
g2y4y55b64.skadnetwork
SKAdNetworkIdentifier
gta9lk7p23.skadnetwork
SKAdNetworkIdentifier
hs6bdukanm.skadnetwork
SKAdNetworkIdentifier
kbd757ywx3.skadnetwork
SKAdNetworkIdentifier
kbmxgpxpgc.skadnetwork
SKAdNetworkIdentifier
klf5c3l5u5.skadnetwork
SKAdNetworkIdentifier
m8dbw4sv7c.skadnetwork
SKAdNetworkIdentifier
mlmmfzh3r3.skadnetwork
SKAdNetworkIdentifier
mtkv5xtk9e.skadnetwork
SKAdNetworkIdentifier
n6fk4nfna4.skadnetwork
SKAdNetworkIdentifier
n9x2a789qt.skadnetwork
SKAdNetworkIdentifier
ppxm28t8ap.skadnetwork
SKAdNetworkIdentifier
prcb7njmu6.skadnetwork
SKAdNetworkIdentifier
pwa73g5rt2.skadnetwork
SKAdNetworkIdentifier
pwdxu55a5a.skadnetwork
SKAdNetworkIdentifier
qqp299437r.skadnetwork
SKAdNetworkIdentifier
r45fhb6rf7.skadnetwork
SKAdNetworkIdentifier
rx5hdcabgc.skadnetwork
SKAdNetworkIdentifier
t38b2kh725.skadnetwork
SKAdNetworkIdentifier
tl55sbb4fm.skadnetwork
SKAdNetworkIdentifier
u679fj5vs4.skadnetwork
SKAdNetworkIdentifier
uw77j35x4d.skadnetwork
SKAdNetworkIdentifier
v72qych5uu.skadnetwork
SKAdNetworkIdentifier
wg4vff78zm.skadnetwork
SKAdNetworkIdentifier
wzmmz9fp6w.skadnetwork
SKAdNetworkIdentifier
yclnxrl5pm.skadnetwork
SKAdNetworkIdentifier
ydx93a7ass.skadnetwork
SKAdNetworkIdentifier
3qcr597p9d.skadnetwork
SKAdNetworkIdentifier
3qy4746246.skadnetwork
SKAdNetworkIdentifier
3sh42y64q3.skadnetwork
SKAdNetworkIdentifier
424m5254lk.skadnetwork
SKAdNetworkIdentifier
4dzt52r2t5.skadnetwork
SKAdNetworkIdentifier
578prtvx9j.skadnetwork
SKAdNetworkIdentifier
5a6flpkh64.skadnetwork
SKAdNetworkIdentifier
8c4e2ghe7u.skadnetwork
SKAdNetworkIdentifier
av6w8kgt66.skadnetwork
SKAdNetworkIdentifier
cstr6suwn9.skadnetwork
SKAdNetworkIdentifier
f38h382jlk.skadnetwork
SKAdNetworkIdentifier
p78axxw29g.skadnetwork
SKAdNetworkIdentifier
s39g8k73mm.skadnetwork
SKAdNetworkIdentifier
v4nxqhlyqp.skadnetwork
SKAdNetworkIdentifier
zq492l623r.skadnetwork
SKAdNetworkIdentifier
24t9a8vw3c.skadnetwork
SKAdNetworkIdentifier
32z4fx6l9h.skadnetwork
SKAdNetworkIdentifier
54nzkqm89y.skadnetwork
SKAdNetworkIdentifier
6xzpu9s2p8.skadnetwork
SKAdNetworkIdentifier
79pbpufp6p.skadnetwork
SKAdNetworkIdentifier
9b89h5y424.skadnetwork
SKAdNetworkIdentifier
c3frkrj4fj.skadnetwork
SKAdNetworkIdentifier
feyaarzu9v.skadnetwork
SKAdNetworkIdentifier
ggvn48r87g.skadnetwork
SKAdNetworkIdentifier
glqzh8vgby.skadnetwork
SKAdNetworkIdentifier
k674qkevps.skadnetwork
SKAdNetworkIdentifier
ludvb6z3bs.skadnetwork
SKAdNetworkIdentifier
rvh3l7un93.skadnetwork
SKAdNetworkIdentifier
x8jxxk4ff5.skadnetwork
SKAdNetworkIdentifier
xy9t38ct57.skadnetwork
SKAdNetworkIdentifier
zmvfpc5aq8.skadnetwork
SKAdNetworkIdentifier
n38lu8286q.skadnetwork
SKAdNetworkIdentifier
v9wttpbfk9.skadnetwork
SKAdNetworkIdentifier
22mmun2rn5.skadnetwork
SKAdNetworkIdentifier
252b5q8x7y.skadnetwork
SKAdNetworkIdentifier
9g2aggbj52.skadnetwork
SKAdNetworkIdentifier
dzg6xy7pwj.skadnetwork
SKAdNetworkIdentifier
f73kdq92p3.skadnetwork
SKAdNetworkIdentifier
hdw39hrw9y.skadnetwork
SKAdNetworkIdentifier
x8uqf25wch.skadnetwork
SKAdNetworkIdentifier
y45688jllp.skadnetwork
SKAdNetworkIdentifier
97r2b46745.skadnetwork
SKAdNetworkIdentifier
b9bk5wbcq9.skadnetwork
SKAdNetworkIdentifier
mls7yz5dvl.skadnetwork
SKAdNetworkIdentifier
w9q455wk68.skadnetwork
SKAdNetworkIdentifier
su67r6k2v3.skadnetwork
SKAdNetworkIdentifier
737z793b9f.skadnetwork
SKAdNetworkIdentifier
r26jy69rpl.skadnetwork
SKAdNetworkIdentifier
238da6jt44.skadnetwork
SKAdNetworkIdentifier
488r3q3dtq.skadnetwork
SKAdNetworkIdentifier
52fl2v3hgk.skadnetwork
SKAdNetworkIdentifier
5tjdwbrq8w.skadnetwork
SKAdNetworkIdentifier
9yg77x724h.skadnetwork
SKAdNetworkIdentifier
ecpz2srf59.skadnetwork
SKAdNetworkIdentifier
gvmwg8q7h5.skadnetwork
SKAdNetworkIdentifier
lr83yxwka7.skadnetwork
SKAdNetworkIdentifier
n66cz3y3bx.skadnetwork
SKAdNetworkIdentifier
nzq8sh4pbs.skadnetwork
SKAdNetworkIdentifier
pu4na253f3.skadnetwork
SKAdNetworkIdentifier
v79kvwwj4g.skadnetwork
SKAdNetworkIdentifier
yrqqpx2mcb.skadnetwork
SKAdNetworkIdentifier
z4gj7hsk7h.skadnetwork
SKAdNetworkIdentifier
f7s53z58qe.skadnetwork
SKAdNetworkIdentifier
mp6xlyr22a.skadnetwork
SKAdNetworkIdentifier
x44k69ngh6.skadnetwork
SKAdNetworkIdentifier
7953jerfzd.skadnetwork
				
			


2.4 Add AdMob App ID

  • Add GADApplicationIdentifier with String type to your project’s info.plist file.
  • You may edit the info.plist file and add GADApplicationIdentifier to it by using the Open As Source Code option.
				
					GADApplicationIdentifier 
Your MAS AdMob App ID
				
			


3. Create the following files in Xcode under
 Runner

1. MainViewController.h

				
					#import <UIKit/UIKit.h>
#import <Flutter/Flutter.h>
NS_ASSUME_NONNULL_BEGIN
@interface MainViewController : FlutterViewController
@end
NS_ASSUME_NONNULL_END
				
			


2. MainViewController.m

				
					#import "MainViewController.h"
#import "FlutterYodo1Mas.h"
@implementation MainViewController
- (void)viewDidLoad {
    [super viewDidLoad];
    
    [[FlutterYodo1Mas sharedInstance] buildWithController:self];
}
@end
				
			


3. FlutterYodo1Mas.h

				
					#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <Flutter/Flutter.h>
NS_ASSUME_NONNULL_BEGIN
@interface FlutterYodo1Mas : NSObject
+ (FlutterYodo1Mas *)sharedInstance;
- (void)buildWithController:(FlutterViewController *)controller;
@end
NS_ASSUME_NONNULL_END
				
			


4. FlutterYodo1Mas.m

				
					#import "FlutterYodo1Mas.h"
#import <Yodo1MasCore/Yodo1Mas.h>
#import <YYModel/YYModel.h>
#define CHANNEL @"com.yodo1.mas/sdk"
#define METHOD_NATIVE_INIT_SDK @"native_init_sdk"
#define METHOD_NATIVE_IS_AD_LOADED @"native_is_ad_loaded"
#define METHOD_NATIVE_SHOW_AD @"native_show_ad"
#define METHOD_DISMISS_BANNER @"dismiss_banner"
#define METHOD_FLUTTER_INIT_EVENT @"flutter_init_event"
#define METHOD_FLUTTER_AD_EVENT @"flutter_ad_event"
@interface FlutterYodo1Mas()<Yodo1MasRewardAdDelegate, Yodo1MasInterstitialAdDelegate, Yodo1MasBannerAdDelegate>
@property (nonatomic, strong) UIViewController *controller;
@property (nonatomic, strong)  FlutterMethodChannel *channel;
@end
@implementation FlutterYodo1Mas {
}
+ (FlutterYodo1Mas *)sharedInstance {
static FlutterYodo1Mas *_instance = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
_instance = [[FlutterYodo1Mas alloc] init];
});
return _instance;
}
- (instancetype)init {
self = [super init];
if (self) {
[Yodo1Mas sharedInstance].rewardAdDelegate = self;
}
return self;
}
- (void)buildWithController:(FlutterViewController *)controller {
__weak __typeof(self)weakSelf = self;
_controller = controller;
_channel = [FlutterMethodChannel methodChannelWithName:CHANNEL binaryMessenger:controller];
[_channel setMethodCallHandler:^(FlutterMethodCall* call, FlutterResult result) {
if (call.method) {
if ([call.method isEqualToString: METHOD_NATIVE_INIT_SDK]) {
NSString *appKey = call.arguments[@"app_key"];
if (appKey) {
[weakSelf initSdk: appKey];
result(@1);
}
} else if ([call.method isEqualToString: METHOD_NATIVE_IS_AD_LOADED]) {
BOOL isAdLoaded = NO;
NSString *type = call.arguments[@"ad_type"];
if (type) {
if ([type isEqualToString:@"Reward"]) {
isAdLoaded = [[Yodo1Mas sharedInstance] isRewardAdLoaded];
} else if ([type isEqualToString:@"Interstitial"]) {
isAdLoaded = [[Yodo1Mas sharedInstance] isInterstitialAdLoaded];
} if ([type isEqualToString:@"Banner"]) {
isAdLoaded = [[Yodo1Mas sharedInstance] isBannerAdLoaded];
}
}
result(@(isAdLoaded));
} else if ([call.method isEqualToString: METHOD_DISMISS_BANNER]) {
[[Yodo1Mas sharedInstance] dismissBannerAd];
result(nil);
} else if ([call.method isEqualToString: METHOD_NATIVE_SHOW_AD]) {
NSLog(@"Show Ad - %@", call.arguments);
NSString *type = call.arguments[@"ad_type"];
if (type) {
if ([type isEqualToString:@"Reward"]) {
[[Yodo1Mas sharedInstance] showRewardAd];
} else if ([type isEqualToString:@"Interstitial"]) {
[[Yodo1Mas sharedInstance] showInterstitialAd];
} if ([type isEqualToString:@"Banner"]) {
[[Yodo1Mas sharedInstance] showBannerAd];
}
}
result(nil);
} else {
result(FlutterMethodNotImplemented);
}
} else {
result(FlutterMethodNotImplemented);
}
}];
}
- (void)initSdk:(NSString *)appKey {
__weak __typeof(self)weakSelf = self;
[[Yodo1Mas sharedInstance] initWithAppKey:appKey successful:^{
if (weakSelf.channel) {
NSDictionary *json = @{@"successful" : @(YES)};
[weakSelf.channel invokeMethod:METHOD_FLUTTER_INIT_EVENT arguments: json];
}
} fail:^(Yodo1MasError * error) {
if (weakSelf.channel) {
NSDictionary *json = @{@"successful" : @(NO), @"error" : [error getJsonObject]};
[weakSelf.channel invokeMethod:METHOD_FLUTTER_INIT_EVENT arguments: json];
}
}];
}
#pragma mark - Yodo1Masdelegate
- (void)onAdOpened:(Yodo1MasAdEvent *)event {
if (self.channel) {
[self.channel invokeMethod:METHOD_FLUTTER_AD_EVENT arguments: [event getJsonObject]];
}
}
- (void)onAdClosed:(Yodo1MasAdEvent *)event {
if (self.channel) {
[self.channel invokeMethod:METHOD_FLUTTER_AD_EVENT arguments: [event getJsonObject]];
}
}
- (void)onAdError:(Yodo1MasAdEvent *)event error:(Yodo1MasError *)error {
if (self.channel) {
[self.channel invokeMethod:METHOD_FLUTTER_AD_EVENT arguments: [event getJsonObject]];
}
}
- (void)onAdRewardEarned:(Yodo1MasAdEvent *)event {
if (self.channel) {
[self.channel invokeMethod:METHOD_FLUTTER_AD_EVENT arguments: [event getJsonObject]];
}
}
@end
				
			


4. Open Main.storyboard using a text editor

Update the customClass value:

				
					customClass="MainViewController"
				
			


5. Create a new Dart file named ‘Yodo1Mas’ under the same directory as main.dart

Put the following code in the newly created dart file.

				
					import 'package:flutter/services.dart';
import 'dart:convert';
class Yodo1Mas {
static const _CHANNEL = "com.yodo1.mas/sdk";
static const _METHOD_NATIVE_INIT_SDK = "native_init_sdk";
static const _METHOD_NATIVE_IS_AD_LOADED = "native_is_ad_loaded";
static const _METHOD_NATIVE_SHOW_AD = "native_show_ad";
static const _METHOD_FLUTTER_INIT_EVENT = "flutter_init_event";
static const _METHOD_FLUTTER_AD_EVENT = "flutter_ad_event";
static const _METHOD_DISMISS_BANNER = "dismiss_banner";
static const AD_TYPE_REWARD = 1;
static const AD_TYPE_INTERSTITIAL = 2;
static const AD_TYPE_BANNER = 3;
static const AD_EVENT_OPENED = 1001;
static const AD_EVENT_CLOSED = 1002;
static const AD_EVENT_ERROR = 1003;
static const AD_EVENT_EARNED = 2001;
static const _channel = const MethodChannel(_CHANNEL);
Yodo1Mas._privateConstructor();
static final Yodo1Mas instance = Yodo1Mas._privateConstructor();
Function(bool successful)? _initCallback;
Function(int event, String message)? _rewardCallback;
Function(int event, String message)? _interstitialCallback;
Function(int event, String message)? _bannerCallback;
void init(String appKey, Function(bool successful)? callback) {
_initCallback = callback;
_channel.setMethodCallHandler((call) {
switch(call.method) {
case _METHOD_FLUTTER_INIT_EVENT: {
bool successful = call.arguments["successful"];
if (_initCallback != null) {
_initCallback!(successful);
}
return Future.value(true);
}
case _METHOD_FLUTTER_AD_EVENT: {
Map<String, dynamic> map = json.decode(call.arguments);
int type = map["type"];
int code = map["code"];
String message = map["message"];
switch (type) {
case AD_TYPE_REWARD:
if (_rewardCallback != null) {
_rewardCallback!(code, message);
}
break;
case AD_TYPE_INTERSTITIAL:
if (_interstitialCallback != null) {
_interstitialCallback!(code, message);
}
break;
case AD_TYPE_BANNER:
if (_bannerCallback != null) {
_bannerCallback!(code, message);
}
break;
}
return Future.value(true);
}
}
return Future.value(true);
});
_channel.invokeMethod(_METHOD_NATIVE_INIT_SDK, {"app_key": appKey});
}
void setRewardListener(Function(int event, String message)? callback) {
_rewardCallback = callback;
}
void setInterstitialListener(Function(int event, String message)? callback) {
_interstitialCallback = callback;
}
void setBannerListener(Function(int event, String message)? callback) {
_bannerCallback = callback;
}
Future<bool?> isRewardAdLoaded() {
return _channel.invokeMethod(_METHOD_NATIVE_IS_AD_LOADED, {"ad_type" : "Reward"});
}
void showRewardAd() {
_channel.invokeMethod(_METHOD_NATIVE_SHOW_AD, {"ad_type" : "Reward"});
}
Future<bool?> isInterstitialAdLoaded() {
return _channel.invokeMethod(_METHOD_NATIVE_IS_AD_LOADED, {"ad_type" : "Interstitial"});
}
void showInterstitialAd() {
_channel.invokeMethod(_METHOD_NATIVE_SHOW_AD, {"ad_type" : "Interstitial"});
}
Future<bool?> isBannerAdLoaded() {
return _channel.invokeMethod(_METHOD_NATIVE_IS_AD_LOADED, {"ad_type" : "Banner"});
}
void showBannerAd() {
_channel.invokeMethod(_METHOD_NATIVE_SHOW_AD, {"ad_type" : "Banner"});
}
void dismissBannerAd() {
_channel.invokeMethod(_METHOD_DISMISS_BANNER);
}
}
				
			


6. Initialize the SDK

Please add the following code in main.dart. Don’t forget to update your AppKey.

				
					import 'package:flutter/material.dart';
import 'Yodo1Mas.dart';
void main() {
  startInitSdk();
}
void startInitSdk()
{
  Yodo1Mas.instance.init("Appkey", (successful) {
  });
}
				
			


7. Comply With Legal Framework

Custom privacy dialog

When you use your own privacy dialog :

  • If the user’s age >= 13, then set COPPA to false, otherwise set it to true.
  • If the user’s age >= 16 and consents to having his data collected, then set GDPR to true, otherwise set it to false.
  • If the user consents to having his data collected, then set CCPA to false, otherwise set it to true.

You’ll find the details about how to set the legal frameworks through these links:

MAS privacy dialog

You can enable the built-in privacy compliance dialog to collect the users’ age and consent.

1. Enable (Before the initialization)

				
					Yodo1MasAdBuildConfig config = new Yodo1MasAdBuildConfig.Builder().enableUserPrivacyDialog(true).build();    
Yodo1Mas.getInstance().setAdBuildConfig(config);
				
			


2. Custom user agreement (optional)

				
					Yodo1MasAdBuildConfig config = new Yodo1MasAdBuildConfig.Builder().enableUserPrivacyDialog(true).userAgreementUrl("Your user agreement url").build();    
Yodo1Mas.getInstance().setAdBuildConfig(config);
				
			


3. Custom privacy policy (optional)

				
					Yodo1MasAdBuildConfig config = new Yodo1MasAdBuildConfig.Builder().enableUserPrivacyDialog(true).privacyPolicyUrl("Your privacy policy url").build();    
Yodo1Mas.getInstance().setAdBuildConfig(config);
				
			


8. Set Delegates

For the banners

				
					Yodo1Mas.instance.setBannerListener((event, message) {
 switch(event) {
   case Yodo1Mas.AD_EVENT_OPENED:
     print('Banner AD_EVENT_OPENED');
     break;
   case Yodo1Mas.AD_EVENT_ERROR:
     print('Banner AD_EVENT_ERROR' + message);
     break;
   case Yodo1Mas.AD_EVENT_CLOSED:
     print('Banner AD_EVENT_CLOSED');
     break;
 }
});
				
			


For the interstitials

				
					Yodo1Mas.instance.setInterstitialListener((event, message) {
 switch(event) {
   case Yodo1Mas.AD_EVENT_OPENED:
     print('Interstitial AD_EVENT_OPENED');
     break;
   case Yodo1Mas.AD_EVENT_ERROR:
     print('Interstitial AD_EVENT_ERROR' + message);
     break;
   case Yodo1Mas.AD_EVENT_CLOSED:
     print('Interstitial AD_EVENT_CLOSED');
     break;
 }
});
				
			


For the rewarded videos

				
					Yodo1Mas.instance.setRewardListener((event, message) {
 switch(event) {
   case Yodo1Mas.AD_EVENT_OPENED:
     print('RewardVideo AD_EVENT_OPENED');
     break;
   case Yodo1Mas.AD_EVENT_ERROR:
     print('RewardVideo AD_EVENT_ERROR' + message);
     break;
   case Yodo1Mas.AD_EVENT_CLOSED:
     print('RewardVideo AD_EVENT_CLOSED');
     break;
   case Yodo1Mas.AD_EVENT_EARNED:
     print('RewardVideo AD_EVENT_EARNED');
     break;
 }
});
				
			


9. Show the ads

You can use the following methods for the different types of ads.

Show a banner

				
					Yodo1Mas.instance.showBannerAd();
				
			


Hide a banner

				
					Yodo1Mas.instance.dismissBannerAd();
				
			


Show an interstitial

				
					Yodo1Mas.instance.showInterstitialAd();
				
			

 

Show a rewarded video

				
					Yodo1Mas.instance.showRewardAd();
				
			

For next step please test your integration

CONTENTS