使用Admob-free plugin。
如何触发间隙关闭事件,
//this is the code found for javscript
document.addEventListener('admob.interstitial.events.CLOSE', function (event) {
console.log(event)
admob.interstitial.prepare()
})
//i want this code in ionic3 有人可以帮助如何在typescript/ ionic3中做到这一点吗?
document.addEventListener在typescript中显示错误
发布于 2017-09-10 05:54:48
import {Component, Renderer} from '@angular/core';
constructor(renderer: Renderer) {
renderer.listenGlobal('document', 'admob.interstitial.events.CLOSE', (event) => {
console.log(event);
});
}你可以这样做
发布于 2020-01-06 23:09:54
最好的方法就是像下面这样,但是不要忘记在构造函数中注册AdmobFree
constructor(
private admobFree: AdMobFree,
public platform: Platform
) {
// Handle interstitial's close event
this.admobFree.on('admob.interstitial.events.CLOSE').subscribe(() => {
// handle interstitial close
});
}https://stackoverflow.com/questions/45506757
复制相似问题