Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Typescript 如何在关闭无离子3/Admob间质后重置间质_关闭的事件侦听器?_Typescript_Ionic3_Event Listener_Cordova Admob - Fatal编程技术网

Typescript 如何在关闭无离子3/Admob间质后重置间质_关闭的事件侦听器?

Typescript 如何在关闭无离子3/Admob间质后重置间质_关闭的事件侦听器?,typescript,ionic3,event-listener,cordova-admob,Typescript,Ionic3,Event Listener,Cordova Admob,在配置了填隙后,我遇到了一个问题 首先,我能够用下面的配置显示Interstitual let interConfig:admobfreealconfig={ ISTEST:错, 汽车展:是的, id:this.adconfig.idInterstical, }; this.admob.interstitual.config(interConfig); 这是间质的 .准备 .然后(()=>{ console.log(“显示仪表”); }) .catch((e)=>console.log(e));

在配置了填隙后,我遇到了一个问题

首先,我能够用下面的配置显示Interstitual

let interConfig:admobfreealconfig={
ISTEST:错,
汽车展:是的,
id:this.adconfig.idInterstical,
};
this.admob.interstitual.config(interConfig);
这是间质的
.准备
.然后(()=>{
console.log(“显示仪表”);
})
.catch((e)=>console.log(e));
我在my Home.ts中调用了两次此代码,每次调用我都会设置一个侦听器,在用户关闭中间层时执行特定的操作

this.admob.on(this.admob.events.interstitual\u CLOSE)。订阅(()=>{
这个函数是1();
});
用另一种方法

this.admob.on(this.admob.events.interstitual\u CLOSE)。订阅(()=>{
这个函数是2();
});
我的问题是。。。第一次关闭中间层时,一切都很好,比如说我关闭了,第一个场景调用了
this.function1()
方法,但是从第二次调用开始,侦听器被附加到中间层关闭,例如,如果我执行第二个场景关闭并执行
this.function2()
执行
this.function2()
后,将再次调用
this.function1()

我做错了什么?如何重置侦听器