-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.ts
52 lines (39 loc) · 1.26 KB
/
index.ts
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
// main index.js
import {NativeModules} from 'react-native';
const {ReactNativeAdmobile} = NativeModules;
export namespace ReactNativeAdmobileUtils {
export function initAd(appid: string) {
return ReactNativeAdmobile.initAd(appid);
}
/**
* 开屏广告
* @param adId
* @param onSuccess
* @param onError
*/
export function splashAd(adId: string, onSuccess:(res?:any)=>void, onError:(e?:any)=>void) {
ReactNativeAdmobile.splashAd(adId, onSuccess, onError);
}
/**
* 激励广告
* @param adId
* @param onSuccess
* @param onError
*/
export function rewardVodAd(adId: string, onSuccess:(res?:any)=>void, onError:(e?:any)=>void) {
ReactNativeAdmobile.rewardVodAd(adId, onSuccess, onError);
}
/**
* 插屏广告
* @param adId
* @param onSuccess
* @param onError
*/
export function intertitialAd(adId: string,onSuccess:(res?:any)=>void, onError:(e?:any)=>void) {
ReactNativeAdmobile.intertitialAd(adId, onSuccess, onError);
}
export function setPersonalizedAdEnabled(personalizedAdEnabled = false) {
ReactNativeAdmobile.setPersonalizedAdEnabled(personalizedAdEnabled);
}
}
export default ReactNativeAdmobileUtils;