Appodeal
Appodeal
插件通过原生Appodeal SDK来投放广告
Repo(备用): https://github.com/appodeal/appodeal-cordova-plugin
Installation(安装)
1.安装Cordova和Ionic原生插件:
$ ionic cordova plugin add https://github.com/appodeal/appodeal-cordova-plugin.git
$ npm install --save @ionic-native/appodeal
Supported platforms(支持平台)
iOS
Android
Usage(用法)
import { Appodeal } from '@ionic-native/appodeal';
constructor(private appodeal: Appodeal) {
const appKey = '<your app key>';
appodeal.initialize(appKey, appodeal.AD_TYPES.REWARDED_VIDEO);
appodeal.show(appodeal.AD_TYPES.REWARDED_VIDEO);
}
Instance Members(实例成员)
初始化Appodeal SDK
| 参数 | 类型 | 详情 |
|---|---|---|
| appKey | string | |
| adType | number |
检查SDK是否初始化完成
****Returns:** Promise<boolean>
显示指定类型的广告
| 参数 | 类型 | 详情 |
|---|---|---|
| adType | number |
****Returns:** Promise<boolean>
showWithPlacement(adType, placement)
使用展示位置选项显示指定类型的广告
| 参数 | 类型 | 详情 |
|---|---|---|
| adType | number | |
| placement | any |
****Returns:** Promise<boolean>
隐藏指定类型的广告
| 参数 | 类型 | 详情 |
|---|---|---|
| adType | number |
确认使用指定类型的广告
| 参数 | 类型 | 详情 |
|---|---|---|
| adType | number |
检查是否已经加载了指定类型的广告
| 参数 | 类型 | 详情 |
|---|---|---|
| adType | number |
****Returns:** Promise<boolean>
检查指定的广告
| 参数 | 类型 | 详情 |
|---|---|---|
| adType | number |
****Returns:** Promise<boolean>
setAutoCache(adType, autoCache)
| 参数 | 类型 | 详情 |
|---|---|---|
| adType | number | |
| autoCache |
按类型强制缓存广告
| 参数 | 类型 | 详情 |
|---|---|---|
| adType | number |
| 参数 | 类型 | 详情 |
|---|---|---|
| set | boolean |
启用或禁用智能横幅
| 参数 | 类型 | 详情 |
|---|---|---|
| enabled | boolean |
启用或禁用横幅背景
| 参数 | 类型 | 详情 |
|---|---|---|
| enabled | boolean |
启用或禁用横幅动画
| 参数 | 类型 | 详情 |
|---|---|---|
| enabled | boolean |
| 参数 | 类型 | 详情 |
|---|---|---|
| value |
启用或禁用日志记录
| 参数 | 类型 | 详情 |
|---|---|---|
| logging | boolean |
启用或禁用测试模式
| 参数 | 类型 | 详情 |
|---|---|---|
| testing | boolean |
重置设备ID
getVersion()
获取 Appdeal SDK版本
disableNetwork(network, adType)
| 参数 | 类型 | 详情 |
|---|---|---|
| network | string | |
| adType | number |
disableNetworkType(network, adType)
| 参数 | 类型 | 详情 |
|---|---|---|
| network | string | |
| adType | number |
disableLocationPermissionCheck()
禁用Appodeal SDK的位置权限
disableWriteExternalStoragePermissionCheck()
禁用Appode SDK的存储权限
enableInterstitialCallbacks(enabled)
启用事件侦听器
| 参数 | 类型 | 详情 |
|---|---|---|
| enabled | boolean |
enableSkippableVideoCallbacks(enabled)
启用事件侦听器
| 参数 | 类型 | 详情 |
|---|---|---|
| enabled | boolean |
enableNonSkippableVideoCallbacks(enabled)
启用事件侦听器
| 参数 | 类型 | 详情 |
|---|---|---|
| enabled | boolean |
enableBannerCallbacks(enabled)
启用事件侦听器
| 参数 | 类型 | 详情 |
|---|---|---|
| enabled | boolean |
enableRewardedVideoCallbacks(enabled)
启用事件侦听器
| 参数 | 类型 | 详情 |
|---|---|---|
| enabled | boolean |
setCustomBooleanRule(name, value)
| 参数 | 类型 | 详情 |
|---|---|---|
| name | string | name of rule |
| value | boolean |
setCustomIntegerRule(name, value)
| 参数 | 类型 | 详情 |
|---|---|---|
| name | string | name of rule |
| value | number |
setCustomDoubleRule(name, value)
用float值设置规则
| 参数 | 类型 | 详情 |
|---|---|---|
| name | string | |
| value | number |
setCustomStringRule(name, value)
用string值设置规则
| 参数 | 类型 | 详情 |
|---|
name|string|name of rule
value|string|
在当前用户的Appodeal中设置ID首选项
| 参数 | 类型 | 详情 |
|---|---|---|
| id |
在当前用户的Appodeal中设置电子邮件首选项
| 参数 | 类型 | 详情 |
|---|---|---|
在当前用户的Appodeal中设置生日偏好
| 参数 | 类型 | 详情 |
|---|---|---|
| birthday |
在当前用户的Appodeal中设置年龄首选项
| 参数 | 类型 | 详情 |
|---|---|---|
| age |
在当前用户的Appodeal中设置“性别”首选项
| 参数 | 类型 | 详情 |
|---|---|---|
| gender |
在当前用户的Appodeal中设置职业偏好
| 参数 | 类型 | 详情 |
|---|---|---|
| occupation |
在当前用户的Appodeal中设置关系首选项
| 参数 | 类型 | 详情 |
|---|---|---|
| relation |
在当前用户的Appodeal中设置吸烟偏好
| 参数 | 类型 | 详情 |
|---|---|---|
| smoking |
在当前用户的Appodeal中设置喝酒偏好
| 参数 | 类型 | 详情 |
|---|---|---|
| alcohol |
在当前用户的Appodeal中设置兴趣爱好
| 参数 | 类型 | 详情 |
|---|---|---|
| interests |
onSkippableVideoFailedToLoad()