科尔多瓦对滞留在队列中的Andr​​oid navigator.notification.confirm回调 [英] Cordova on Android navigator.notification.confirm callbacks stuck in queue

查看:208
本文介绍了科尔多瓦对滞留在队列中的Andr​​oid navigator.notification.confirm回调的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个有点长镜头,但我要问,看看其他人都经历过类似的话。

我们正在创造一个科尔多瓦(3.3.0)的iOS / Android应用程序。在iOS上一切都很好。 在Android(测试与Android模拟器或三星8标签4.2.2)时navigator.notification.confirm被调用,我们经常看到的确认对话框中的一个按钮后,不还以颜色JS回调已经pressed。

调试科尔多瓦(本机端),我们看到pssed按钮$ P $,驳回了本地对话框,并添加到JsMessageQueue回调消息。但队列似乎并没有得到处理,直到别的东西迫使它是。例如,另一个调用navigator.notification.confirm随后将导致排队消息到运行。

我们已经把额外的日志记录到NativeToJSMessageQueue上setPaused,看看有什么东西在没有恢复暂停,但它看起来不错。

我敢肯定,我们已经做了一些扰乱它。有什么根本性的,基本上被处理,我们应该知道的停止消息队列?东西在javaside将导致在Android科尔多瓦不检查队列?

我们没有看到在iOS上的问题,但我敢肯定,这是因为它并没有使用相同的邮件寄发系统的Andr​​oid。

对不起,缺乏code或任何更多的信息。我希望这可以圈数铃铛。

更新: 我们已经做了一些更多的调试,它似乎有事情做与全屏模式。如果以全屏模式(通过配置)或本机$ C $集合C的事件做火。 如果全屏模式设置为false回调事件被留在队列中,并尽快烧制作为按钮是pressed第二时间

 函数onConfirm(buttonIndex){
    警报('您选择按钮+ buttonIndex);
}

功能testButton()
{
   navigator.notification.confirm(你是冠军!,onConfirm,'游戏结束',[Butt1,Butt2]);
}
 

解决方案

这已被固定在科尔多瓦3.6.0。

This is a bit of a long shot but I'm going to ask to see if others have experienced anything similar.

We are creating a cordova ( 3.3.0 ) iOS / Android app. On iOS all is well. On Android ( testing with Android emulators or a Samsung 8 Tab 4.2.2 ) when navigator.notification.confirm is called we quite often see the callback not fired back in JS after one of the confirm dialog buttons has been pressed.

Debugging Cordova ( native side ) we see the button pressed, the native dialog dismissed and the callback message added to the JsMessageQueue. But the queue doesn't seem to be serviced until something else forces it to be. For example, another call to navigator.notification.confirm would then causes the queued message to run.

We've put extra logging into the NativeToJSMessageQueue on setPaused to see if something was not restoring the pause but it looks ok.

I'm sure we've done something to upset it. Is there anything fundamental that basically stops the message queue from being processed that we should be aware of ? Something that on the javaside would cause cordova on Android not to check the queue ?

We don't see the problem on iOS but I'm sure this is because it doesn't use the same message despatch system as Android.

Sorry for the lack of code or any more info. I was hoping this may ring a few bells.

Update : We've done a little more debugging and it appears to have something to do with fullscreen mode. If set in fullscreen mode ( via the config ) or native code the events do fire. If fullscreen mode is set to false the callback event is left in the queue, and fired as soon as the button is pressed a second time.

function onConfirm(buttonIndex) {
    alert('You selected button ' + buttonIndex);
}

function testButton()
{
   navigator.notification.confirm('You are the winner!',onConfirm, 'Game Over', ["Butt1","Butt2"]);
}

解决方案

This has been fixed in Cordova 3.6.0.

这篇关于科尔多瓦对滞留在队列中的Andr​​oid navigator.notification.confirm回调的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆