-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAMInterCustomEvent.m
More file actions
78 lines (54 loc) · 1.95 KB
/
AMInterCustomEvent.m
File metadata and controls
78 lines (54 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//
// AMInterCustomEvent.m
// mcivik
//
// Created by mcivik on 26/11/14.
// Copyright (c) 2014 mcivik. All rights reserved.
//
#import "AMInterCustomEvent.h"
@implementation AMInterCustomEvent
- (void)requestInterstitialWithCustomEventInfo:(NSDictionary *)info
{
self.amazonAdView = [AmazonAdInterstitial amazonAdInterstitial];
// Register the ViewController with the delegate to receive callbacks.
self.amazonAdView.delegate = self;
AmazonAdOptions *options = [AmazonAdOptions options];
#if DEBUG
// options.isTestRequest = YES;
#endif
// Load an interstitial
[self.amazonAdView load:options];
}
#pragma mark - AmazonAdInterstitialDelegate
- (void)interstitialDidLoad:(AmazonAdInterstitial *)interstitial
{
[app activate_interstitial_window];
[self.amazonAdView presentFromViewController:app.alertWindow.rootViewController];
[self.delegate interstitialCustomEvent:self didLoadAd:interstitial];
}
- (void)interstitialDidFailToLoad:(AmazonAdInterstitial *)interstitial withError:(AmazonAdError *)error
{
NSLog(@"Interstitial failed to load. %@", error.errorDescription);
[self.delegate interstitialCustomEvent:self didFailToLoadAdWithError:nil];
}
- (void)interstitialWillPresent:(AmazonAdInterstitial *)interstitial
{
NSLog(@"Interstitial will be presented.");
[self.delegate interstitialCustomEventWillAppear: self];
}
- (void)interstitialDidPresent:(AmazonAdInterstitial *)interstitial
{
[self.delegate interstitialCustomEventDidAppear: self];
}
- (void)interstitialWillDismiss:(AmazonAdInterstitial *)interstitial
{
NSLog(@"Interstitial will be dismissed.");
[app deactivate_interstitial_window];
[self.delegate interstitialCustomEventWillDisappear: self];
}
- (void)interstitialDidDismiss:(AmazonAdInterstitial *)interstitial
{
NSLog(@"Interstitial has been dismissed.");
[self.delegate interstitialCustomEventDidDisappear:self];
}
@end