IMInterstitial.h
4.12 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
//
// IMInterstitial.h
// InMobi Monetization SDK
//
// Copyright (c) 2013 InMobi. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "InMobi.h"
#import "IMInterstitialDelegate.h"
#import "IMIncentivisedDelegate.h"
@protocol IMNetworkExtras;
/**
* Class to display an Interstitial Ad.
* Interstitials are full screen advertisements that are shown at natural
* transition points in your application such as between game levels, when
* switching news stories, in general when transitioning from one view controller
* to another. It is best to request for an interstitial several seconds before
* when it is actually needed, so that it can preload its content and become
* ready to present, and when the time comes, it can be immediately presented to
* the user with a smooth experience.
*/
@interface IMInterstitial : NSObject
#pragma mark - Initialization
/**
* Initializes an IMInterstitial instance with the specified appId.
* @param appId Application Id registered on the InMobi portal.
* @note |appId| is required to be non empty, else the instance of
* IMInterstitial is not created and nil is returned instead.
*/
- (id)initWithAppId:(NSString *)appId;
/**
* Initializes an IMInterstitial instance, and sets the specified slot id.
* @param slotId Slot id to uniquely identify a placement in your app.
*/
- (id)initWithSlotId:(long long)slotId;
#pragma mark - Initialization for IB Integration
/**
* Application Id for the request.
* @note Use the application id registered on the InMobi portal.
*/
@property (nonatomic, copy) NSString *appId;
/**
* Slot id is the specific placement id for the request.
* @note Use the slot id registered on the InMobi portal.
*/
@property (nonatomic) long long slotId;
#pragma mark - Loading Interstitial
/**
* Loads the Interstitial. Additional targetting options may be provided using
* the InMobi class.
* It is best to call this method several seconds before the interstitial is
* needed to preload its content. Once, it is fetched and is ready to display,
* you can present it using presentInterstitialAnimated: method.
*/
- (void)loadInterstitial;
/**
* Stops the current loading of the Interstitial if in progress.
*/
- (void)stopLoading;
#pragma mark - Presenting Interstitial
/**
* This presents the interstitial ad that takes over the entire screen until
* the user dismisses it. This has no effect unless the interstitial state is
* kIMInterstitialStateReady and/or the delegate's interstitialDidReceiveAd:
* has been received. After the interstitial has been dismissed by the user,
* the delegate's interstitialDidDismissScreen: will be called.
* @param animated Display the interstitial by using an animation. This is
* similar to presenting a Modal-View-Controller like animation, from the bottom.
*/
- (void)presentInterstitialAnimated:(BOOL)animated;
#pragma mark - Optional properties
/**
* Delegate object that receives state change notifications from this
* interstitial object. Typically, this is a UIViewController instance.
* @warning Whenever you release the Interstitial object, make sure to set its
* delegate to nil to prevent any chance of your application crashing.
*/
@property (nonatomic, weak) NSObject<IMInterstitialDelegate> *delegate;
/**
* Delegate object that receives the params when an incentivised action is complete.
* @warning Whenever you release the Interstitial object, make sure to set its
* incentivisedDelegate to nil to prevent any chance of your application crashing.
*/
@property (nonatomic, weak) NSObject<IMIncentivisedDelegate> *incentivisedDelegate;
/**
* Returns the state of the interstitial ad. The delegate's
* interstitialDidFinishRequest: will be called when this switches from the
* kIMInterstitialStateInit state to the kIMInterstitialStateReady state.
*/
@property (readonly) IMInterstitialState state;
/**
* A free form NSDictionary for any demographic information,
* not available via InMobi class.
*/
@property (nonatomic,strong) NSDictionary *additionaParameters;
/**
* A free form set of keywords, separated by ','
* E.g: "sports,cars,bikes"
*/
@property (nonatomic,copy) NSString *keywords;
@end