Phonegap/Cordova应用程序中的线程警告

Pom*_*eyo 17 iphone warnings cordova

我在iPhone(iOS 6)上编译这两个线程警告:

THREAD WARNING: ['InAppBrowser'] took '260.519043' ms. Plugin should use a background thread.
THREAD WARNING: ['Geolocation'] took '110.953857' ms. Plugin should use a background thread.
Run Code Online (Sandbox Code Playgroud)

这就是我在代码中调用插件的方式:

window.open("http://www.anaddress.com", '_system');
Run Code Online (Sandbox Code Playgroud)

这就是我的config.xml的样子:

<?xml version='1.0' encoding='utf-8'?>
<widget id="my.id" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>Hello Cordova</name>
    <description>
        A sample Apache Cordova application that responds to the deviceready event.
    </description>
    <access origin="*" />
    <preference name="AllowInlineMediaPlayback" value="false" />
    <preference name="AutoHideSplashScreen" value="true" />
    <preference name="BackupWebStorage" value="cloud" />
    <preference name="DisallowOverscroll" value="false" />
    <preference name="EnableViewportScale" value="false" />
    <preference name="FadeSplashScreen" value="true" />
    <preference name="FadeSplashScreenDuration" value=".25" />
    <preference name="HideKeyboardFormAccessoryBar" value="false" />
    <preference name="KeyboardDisplayRequiresUserAction" value="true" />
    <preference name="KeyboardShrinksView" value="false" />
    <preference name="MediaPlaybackRequiresUserAction" value="false" />
    <preference name="ShowSplashScreenSpinner" value="true" />
    <preference name="SuppressesIncrementalRendering" value="false" />
    <preference name="TopActivityIndicator" value="gray" />
    <preference name="GapBetweenPages" value="0" />
    <preference name="PageLength" value="0" />
    <preference name="PaginationBreakingMode" value="page" />
    <preference name="PaginationMode" value="unpaginated" />
    <feature name="LocalStorage">
        <param name="ios-package" value="CDVLocalStorage" />
    </feature>
    <feature name="Notification">
        <param name="ios-package" value="CDVNotification" />
    </feature>
    <feature name="Geolocation">
        <param name="ios-package" value="CDVLocation" />
    </feature>
    <feature name="InAppBrowser">
        <param name="ios-package" value="CDVInAppBrowser" />
    </feature>
    <author email="mail@exam.de" href="http://www.example.com">Me
    </author>
    <content src="index.html" />
    <preference name="fullscreen" value="true" />
    <preference name="webviewbounce" value="true" />
</widget>
Run Code Online (Sandbox Code Playgroud)

当然我使用cordova CLI安装了插件:

$ cordova plugin add org.apache.cordova.inappbrowser
Run Code Online (Sandbox Code Playgroud)

任何帮助将不胜感激,谢谢!

Bru*_*uno 6

查看Phonegap文档并搜索"线程"他们解释说您可能希望在后台运行线程而不是主线程.

Apple不喜欢Blocked UI,因此如果需要超过10毫秒,您需要找到取消通话的方法.

虽然您没有收到错误,但只是警告.

  • 谢谢布鲁诺.但我绝对不会说流利的Obj-C.是否有一个工作插件的解决方法?谢谢. (2认同)