-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAdKit.hpp
More file actions
132 lines (117 loc) · 3.44 KB
/
AdKit.hpp
File metadata and controls
132 lines (117 loc) · 3.44 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
//
// AdKit.hpp
// Maw Kit
//
// Created by Lluís Ulzurrun de Asanza Sàez on 18/02/16.
//
//
#ifndef AdKit_hpp
#define AdKit_hpp
#include <functional>
#include <string>
#include <vector>
namespace MK {
/**
* `AdKit` namespace features methods to preload and display ads. This methods
* automatically take into account whether Ads are enabled for this user or
* not.
*/
namespace AdKit {
/// Size of banner view ad.
enum class BannerSize {
/**
* 300x50, phones and tablets. `kGADAdSizeBanner`.
*/
StandardBanner = 0,
/**
* 320x100, phones and tablets. `kGADAdSizeLargeBanner`.
*/
LargeBanner = 1,
/**
* 300x250, phones and tablets. `kGADAdSizeMediumRectangle`.
*/
IABMediumRectangle = 2,
/**
* 468x60, phones and tablets. `kGADAdSizeFullBanner`.
*/
IABFullSizeBanner = 3,
/**
* 728x60, phones and tablets. `kGADAdSizeLeaderboard`.
*/
IABLeaderboard = 4,
/**
* screen width x 32|50|90, phones and tablets.
* `kGADAdSizeSmartBannerPortrait`.
*/
SmartBannerPortrait = 5,
/**
* screen width x 32|50|90, phones and tablets.
* `kGADAdSizeSmartBannerLandscape`.
*/
SmartBannerLandscape = 6
};
/**
* Performs any initialization required by the ads adapter.
*
* @param interstitialUnitID ID of interstitial Ad unit to be queried.
* @param bottomBannerUnitID ID of bottom banner view Ad unit to be queried.
* @param bottomBannerSize Size of bottom banner view Ad.
* @param topBannerUnitID ID of top banner view Ad unit to be queried.
* @param topBannerSize Size of top banner view Ad.
* @param videoRewardUnitID ID of video reward Ad unit to be queried.
* @param adColonyAppID ID of AdColony app to be queried.
* @param adColonyZoneID ID of AdColony zone.
* @param adColonyCustomID AdColony custom param.
* @param testingDevices List of testing devices.
*/
void init( std::string interstitialUnitID = "",
std::string bottomBannerUnitID = "",
BannerSize bottomBannerSize = BannerSize::SmartBannerPortrait,
std::string topBannerUnitID = "",
BannerSize topBannerSize = BannerSize::SmartBannerPortrait,
std::string videoRewardUnitID = "",
std::string adColonyAppID = "",
std::string adColonyZoneID = "",
std::string adColonyCustomID = "",
std::vector<std::string> testingDevices = {} );
/**
* Shows an interstitial ad.
*/
void showInterstitial( std::string adUnitID );
/**
* Shows a top banner ad.
*
* @param adUnitID ID of Ad unit to be queried.
*/
void showTopBanner( std::string adUnitID );
/**
* Shows a bottom banner ad.
*
* @param adUnitID ID of Ad unit to be queried.
*/
void showBottomBanner( std::string adUnitID );
/**
* Shows video reward ad.
*
* @param adUnitID ID of Ad unit to be queried.
* @param callback Callback to be called on video reward end. First parameter
* will be true if user should be rewarded.
*/
void showVideoReward( std::string adUnitID, std::function<void( bool )> callback );
/**
* Returns whether this user has video rewards available or not.
*
* @native
*
* @return Whether this user has video rewards available or not.
*/
bool videoRewardsAvailable();
/**
* Returns whether ads are enabled for this user or not.
*
* @return `true` if this user should see ads.
*/
bool enabled();
}; // namespace ads
}; // namespace LE
#endif /* AdKit_hpp */