解决IOS 13的cordova应用程序上的非阻止功能的问题(警告/确认)

问题描述 投票:0回答:1

我有一个可在iPad上运行的cordova应用,最近我在新的IPadOS 13+上出现了一个非常奇怪的行为。

一些应该阻止代码流并等待用户输入的javascript本机函数(例如window.alert或window.confirm)不再这样做。因此,整个应用程序的功能受到损害。

例如:

if(confirm("Are you sure ?"))
{
    ... // This block is not waiting for user input and executing straight away.
} 

OR

// ... some normal program flow

alert('anything here'); // Normally the program should wait for the user to press 'OK' button.

// ... rest of the code that doesn't wait for the alert to be closed

整个应用程序很麻烦,您知道对此有什么解决方案吗?或有什么可以帮助的吗?我也无法将ios版本降级到12。

PS。我不确定,但这可能是IOS 13的Safari Webview版本的错误吗?

感谢您的帮助

javascript cordova phonegap ios13 sfsafariviewcontroller
1个回答
0
投票

我在使用Cordova的iOS 13时遇到了完全相同的问题,该过程不等待用户在确认或警报框中输入。

if(confirm("Are you sure ?"))
{
    ... // never execute
} 
// execution will not wait for confirm and execute these lines

并且对于iOS 12和Android设备,这仍然可以正常工作。

感谢您的帮助!

© www.soinside.com 2019 - 2024. All rights reserved.