Cordova shows an warning as “ THREAD WARNING: [Your function] took [n] ms. ” in iOS

前端 未结 2 1936
闹比i
闹比i 2021-02-05 16:02
 \"THREAD WARNING: [\'Console\'] took \'81.661865\' ms. Plugin should use a  background thread.\"

While running iOS Phonegap project.

2条回答
  •  不思量自难忘°
    2021-02-05 16:22

    Also to add,

    If someone is looking for a way to run sepcifically the Geolocation plugin as a background thread with iOS Cordova there is a fix on GitHub.

    It removes the Xcode output warning: "THREAD WARNING: ['Geolocation'] took 'X' ms. Plugin should use a background thread."

    Download the plugin from here: https://github.com/guillaumedev/cordova-plugin-geolocation

    Heres whats changed (runInBackground added): https://github.com/guillaumedev/cordova-plugin-geolocation/commit/8fbceca845441f4f421548f243d2f05573d11225

    More information about Cordova Threading: https://cordova.apache.org/docs/en/dev/guide/platforms/ios/plugin.html#threading

提交回复
热议问题