Ionic iOS "Plugin should use a background thread"


#1

Hi all!

i’ve created an App with Ionic - The app is running on android without problems! :smile:

On iOS the screen flickers between state/route-change. Sometimes there is a blank page or it flickers between multiple states. The xCode console says everytime "THREAD WARNING: [‘PLUGIN’} took ‘XYZ’ ms. Plugin should use a background thread.

Sometimes i check for specials files on the devise or connecting to an api to check some stuff.

I found so much questions about this problem but all threads are without any answers. :disappointed_relieved: So i hope u can help me and some other people to solve this problem.

So…

  • How can i run a background thread? How can i fix the flicker problem?

btw, this dosn’t work:

It only prevents some console warnings (maybe!), but the screen flickers and flickers :frowning:


#2

The flicker problem is a well documented issue with the transitions. There’s about a million different ways that people say to fix it, but none of them work for me. I simply turned off transitions for IOS only and it was resolved. Kinda sucks, but it does the job.

Also looking for info on the error about background threads. Not sure if it’s anything to be concerned about yet tho.


#5

Hi @cmki,

are u using $state.go at the flickering-problem?


#6

I solved my “flicker”-problem by removing some js-errors :slight_smile:


#7

@Ionicoser were those JS-errors in your own script files or in ionic/angular script? and what kind of errors were they?
I also get the Plugin X should use a background thread. wonder how to fix it, since this problem occurs in multiple apps I’m developing.


#8

I was getting the same issue for barcode scanner plugin.

So i replaced the

document.addEventListener(“deviceready”, function () {

//barcode scanner code

});

by

$ionicPlatform.ready(function() {

//barcode scanner code

});

The Xcode log says

“This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app’s Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.”

Any Idea on this?


#9

The issue is solved

Follow this link
http://useyourloaf.com/blog/privacy-settings-in-ios-10/

Just need to add a permission at info.plist