首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无admob的interstitial close event ionic3

无admob的interstitial close event ionic3
EN

Stack Overflow用户
提问于 2017-08-04 20:22:09
回答 2查看 706关注 0票数 1

使用Admob-free plugin

如何触发间隙关闭事件,

代码语言:javascript
复制
//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中显示错误

EN

回答 2

Stack Overflow用户

发布于 2017-09-10 05:54:48

代码语言:javascript
复制
import {Component, Renderer} from '@angular/core';    
constructor(renderer: Renderer) {

            renderer.listenGlobal('document', 'admob.interstitial.events.CLOSE', (event) => {
                console.log(event);
            });

        }

你可以这样做

票数 2
EN

Stack Overflow用户

发布于 2020-01-06 23:09:54

最好的方法就是像下面这样,但是不要忘记在构造函数中注册AdmobFree

代码语言:javascript
复制
constructor(
    private admobFree: AdMobFree,
    public platform: Platform
) {

    // Handle interstitial's close event
    this.admobFree.on('admob.interstitial.events.CLOSE').subscribe(() => {
       // handle interstitial close
    });
}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45506757

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档