UNPKG

8.26 kBTypeScriptView Raw
1import { Observable } from 'rxjs';
2/**
3 * @name Appodeal
4 * @description
5 * Plugin to serve ads through native Appodeal SDKs
6 *
7 * @usage
8 * ```
9 * import { Appodeal } from 'ionic-native';
10 *
11 * let appKey = '<your app key>';
12 * Appodeal.initialize(appKey, Appodeal.AD_TYPES.REWARDED_VIDEO);
13 * Appodeal.show(Appodeal.AD_TYPES.REWARDED_VIDEO);
14 *
15 * ```
16 */
17export declare class Appodeal {
18 static readonly AD_TYPES: {
19 INTERSTITIAL: number;
20 SKIPPABLE_VIDEO: number;
21 BANNER: number;
22 BANNER_BOTTOM: number;
23 BANNER_TOP: number;
24 REWARDED_VIDEO: number;
25 NON_SKIPPABLE_VIDEO: number;
26 };
27 /**
28 * initialize Appodeal SDK
29 * @param {string} appKey
30 * @param {number} adType
31 */
32 static initialize(appKey: string, adType: number): void;
33 /**
34 * check if SDK has been initialized
35 * @returns {Promise<boolean>}
36 */
37 static isInitialized(): Promise<any>;
38 /**
39 * show ad of specified type
40 * @param {number} adType
41 * @returns {Promise<boolean>}
42 */
43 static show(adType: number): Promise<any>;
44 /**
45 * show ad of specified type with placement options
46 * @param {number} adType
47 * @param {any} placement
48 * @returns {Promise<boolean>}
49 */
50 static showWithPlacement(adType: number, placement: any): Promise<any>;
51 /**
52 * hide ad of specified type
53 * @param {number} adType
54 */
55 static hide(adType: number): void;
56 /**
57 * confirm use of ads of specified type
58 * @param {number} adType
59 */
60 static confirm(adType: number): void;
61 /**
62 * check if ad of specified type has been loaded
63 * @param {number} adType
64 * @returns {Promise<boolean>}
65 */
66 static isLoaded(adType: number): Promise<any>;
67 /**
68 * check if ad of specified
69 * @param {number} adType
70 * @returns {Promise<boolean>}
71 */
72 static isPrecache(adType: number): Promise<any>;
73 /**
74 *
75 * @param {number} adType
76 * @param autoCache
77 */
78 static setAutoCache(adType: number, autoCache: any): void;
79 /**
80 * forcefully cache an ad by type
81 * @param {number} adType
82 */
83 static cache(adType: number): void;
84 /**
85 *
86 * @param {boolean} set
87 */
88 static setOnLoadedTriggerBoth(set: boolean): void;
89 /**
90 * enable or disable Smart Banners
91 * @param {boolean} enabled
92 */
93 static setSmartBanners(enabled: boolean): void;
94 /**
95 * enable or disable banner backgrounds
96 * @param {boolean} enabled
97 */
98 static setBannerBackground(enabled: boolean): void;
99 /**
100 * enable or disable banner animations
101 * @param {boolean} enabled
102 */
103 static setBannerAnimation(enabled: boolean): void;
104 /**
105 *
106 * @param value
107 */
108 static set728x90Banners(value: any): void;
109 /**
110 * enable or disable logging
111 * @param {boolean} logging
112 */
113 static setLogging(logging: boolean): void;
114 /**
115 * enable or disable testing mode
116 * @param {boolean} testing
117 */
118 static setTesting(testing: boolean): void;
119 /**
120 * reset device ID
121 */
122 static resetUUID(): void;
123 /**
124 * get version of Appdeal SDK
125 */
126 static getVersion(): Promise<any>;
127 /**
128 *
129 * @param {string} network
130 * @param {number} adType
131 */
132 static disableNetwork(network?: string, adType?: number): void;
133 /**
134 *
135 * @param {string} network
136 * @param {number} adType
137 */
138 static disableNetworkType(network?: string, adType?: number): void;
139 /**
140 * disable Location permissions for Appodeal SDK
141 */
142 static disableLocationPermissionCheck(): void;
143 /**
144 * disable Storage permissions for Appodeal SDK
145 */
146 static disableWriteExternalStoragePermissionCheck(): void;
147 /**
148 * enable event listeners
149 * @param {boolean} enabled
150 */
151 static enableInterstitialCallbacks(enabled: boolean): void;
152 /**
153 * enable event listeners
154 * @param {boolean} enabled
155 */
156 static enableSkippableVideoCallbacks(enabled: boolean): void;
157 /**
158 * enable event listeners
159 * @param {boolean} enabled
160 */
161 static enableNonSkippableVideoCallbacks(enabled: boolean): void;
162 /**
163 * enable event listeners
164 * @param {boolean} enabled
165 */
166 static enableBannerCallbacks(enabled: boolean): void;
167 /**
168 * enable event listeners
169 * @param {boolean} enabled
170 */
171 static enableRewardedVideoCallbacks(enabled: boolean): void;
172 /**
173 *
174 * @param {string} name - name of rule
175 * @param {boolean} value
176 */
177 static setCustomBooleanRule(name: string, value: boolean): void;
178 /**
179 *
180 * @param {string} name - name of rule
181 * @param {number} value
182 */
183 static setCustomIntegerRule(name: string, value: number): void;
184 /**
185 * set rule with float value
186 * @param {string} name
187 * @param {number} value
188 */
189 static setCustomDoubleRule(name: string, value: number): void;
190 /**
191 * set rule with string value
192 * @param {string} name - name of rule
193 * @param {string} value
194 */
195 static setCustomStringRule(name: string, value: string): void;
196 /**
197 * set ID preference in Appodeal for current user
198 * @param id
199 */
200 static setUserId(id: any): void;
201 /**
202 * set Email preference in Appodeal for current user
203 * @param email
204 */
205 static setEmail(email: any): void;
206 /**
207 * set Birthday preference in Appodeal for current user
208 * @param birthday
209 */
210 static setBirthday(birthday: any): void;
211 /**
212 * et Age preference in Appodeal for current user
213 * @param age
214 */
215 static setAge(age: any): void;
216 /**
217 * set Gender preference in Appodeal for current user
218 * @param gender
219 */
220 static setGender(gender: any): void;
221 /**
222 * set Occupation preference in Appodeal for current user
223 * @param occupation
224 */
225 static setOccupation(occupation: any): void;
226 /**
227 * set Relation preference in Appodeal for current user
228 * @param relation
229 */
230 static setRelation(relation: any): void;
231 /**
232 * set Smoking preference in Appodeal for current user
233 * @param smoking
234 */
235 static setSmoking(smoking: any): void;
236 /**
237 * set Alcohol preference in Appodeal for current user
238 * @param alcohol
239 */
240 static setAlcohol(alcohol: any): void;
241 /**
242 * set Interests preference in Appodeal for current user
243 * @param interests
244 */
245 static setInterests(interests: any): void;
246 /*********************
247 * event Observables *
248 *********************/
249 static onInterstitialLoaded(): Observable<any>;
250 static onInterstitialFailedToLoad(): Observable<any>;
251 static onInterstitialShown(): Observable<any>;
252 static onInterstitialClicked(): Observable<any>;
253 static onInterstitialClosed(): Observable<any>;
254 static onSkippableVideoLoaded(): Observable<any>;
255 static onSkippableVideoFailedToLoad(): Observable<any>;
256 static onSkippableVideoShown(): Observable<any>;
257 static onSkippableVideoFinished(): Observable<any>;
258 static onSkippableVideoClosed(): Observable<any>;
259 static onRewardedVideoLoaded(): Observable<any>;
260 static onRewardedVideoFailedToLoad(): Observable<any>;
261 static onRewardedVideoShown(): Observable<any>;
262 static onRewardedVideoFinished(): Observable<any>;
263 static onRewardedVideoClosed(): Observable<any>;
264 static onNonSkippableVideoLoaded(): Observable<any>;
265 static onNonSkippableVideoFailedToLoad(): Observable<any>;
266 static onNonSkippableVideoShown(): Observable<any>;
267 static onNonSkippableVideoFinished(): Observable<any>;
268 static onNonSkippableVideoClosed(): Observable<any>;
269 static onBannerClicked(): Observable<any>;
270 static onBannerFailedToLoad(): Observable<any>;
271 static onBannerLoaded(): Observable<any>;
272 static onBannerShown(): Observable<any>;
273}