簡體   English   中英

如何使PhoneGap IOS插件在后台線程中運行

[英]How do you make PhoneGap IOS plugins run in a background thread

在xCode 6.1中,為IOS運行Cordova 3.6.0,我得到警告,插件應該在后台線程中運行。

我的問題是如何使File,Camera,NetworkStatus,StatusBar,Notification和EmailComposer插件在后台線程中運行?

我將不勝感激。 以下是我在xCode控制台中獲得的輸出。

2014-10-23 06:56:13.683 BackTracker[1689:462317] Multi-tasking -> Device: YES, App: YES 

2014-10-23 06:56:13.726 BackTracker[1689:462317] Unlimited access to network resources 

2014-10-23 06:56:13.739 BackTracker[1689:462317] Started backup to iCloud! Please be careful. Your application might rejected by Apple if you store too much data. For more information please read "iOS Data Storage Guidelines" You could find it at the following address https://developer.apple.com/icloud/documentation/data-storage/ .

2014-10-23 06:56:14.002 BackTracker[1689:462317] [CDVTimer][file] 78.798950ms 

2014-10-23 06:56:14.137 BackTracker[1689:462317] [CDVTimer][splashscreen] 133.718014ms

2014-10-23 06:56:14.147 BackTracker[1689:462317] [CDVTimer][statusbar] 9.751022ms

2014-10-23 06:56:14.148 BackTracker[1689:462317] [CDVTimer][TotalPluginStartup] 224.672019ms 

2014-10-23 06:56:14.432 BackTracker[1689:462317] Resetting plugins due to page load. 

2014-10-23 06:56:16.520 BackTracker[1689:462317] Finished load of: file:///private/var/mobile/Containers/Bundle/Application/532EB1D5-B92A-4939-9FBD-C1EB1E8962CD/BackTracker.app/www/index.html

2014-10-23 06:56:16.709 BackTracker[1689:462317] THREAD WARNING: ['NetworkStatus'] took '54.156250' ms. Plugin should use a background thread. 

2014-10-23 06:56:16.734 BackTracker[1689:462317] THREAD WARNING: ['StatusBar'] took '22.954102' ms. Plugin should use a background thread. 

2014-10-23 06:57:02.175 BackTracker[1689:462317] Application tried to represent an active popover presentation: <UIPopoverPresentationController: 0x17dd0900> 

2014-10-23 07:00:14.995 BackTracker[1689:462317] THREAD WARNING: ['File'] took '10.078857' ms. Plugin should use a background thread. 

2014-10-23 07:00:15.081 BackTracker[1689:462317] THREAD WARNING: ['EmailComposer'] took '56.955078' ms. Plugin should use a background thread.

Cordova有幾種調用本機插件的方法(本機橋接模式)。

在設備就緒事件發生后,嘗試使用XHR OPTIONAL PAYLOAD代替默認的IFRAME_NAV。

exec.setJsToNativeBridgeMode(exec.jsToNativeModes.XHR_OPTIONAL_PAYLOAD);

更多信息: https : //github.com/phonegap/phonegap/blob/master/lib/ios/guides/Changing%20the%20JavaScript%20to%20Native%20Bridge%20Mode.md

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM