Strange behavior only in iOS cause app to wait/pause until I leave screen


#1

Hi guys,

I really hope you can help me out here because I am a little bit lost. I do right now my second Ionic app and feel pretty stable with all but experience now a strange situation and not even know where to start looking for. I try to explain.

My app uses a couple of plugins like the cordova-barcode-scanner, cordova-plugin-facebook4 and cordova-plugin-x-socialsharing. All works fine in Android and both plugins work as expected, how ever in iOS not.

The problem is difficult to describe. What happen is that ALL plugins do work but all have some type of PAUSE until I switch the screen. Lets say I want to scan a Barcode. I press the button in my app which suppose to open the videocamera… how ever nothing happen and you can wait minutes. BUT if you doubleclick the home button to switch the apps for example the camera open and you can switch back to scan your barcode.

Same thing with facebook login plugin or socialshareing. I press the buttons or start the functions but nothing happen at first… if I click on the main menu button from my app (bascially leave the current view) i can see the plugin continue and open for example facebook. same happen if I use the home button and switch apps.

every single plugin in iOS stops/pause until I switch app, or leave the current ionic-view…than all continue normal and work as expected.

anybody has any idea?
in android all normal…

thank you all in advance


#2

I figured it out.

The problem appear to be on iOS 10.x devices. It happen with all plugins in either Simulator or real devices. The reason is that you need in your Content-Security-Policy a small extra parameter for iOS 10.x to work with the plugins.

I just changed “default-src *;” to “default-src * gap://ready file:;” and all plugins work flawless.

For more detailed infos check out https://forums.adobe.com/thread/2167432 which was 100% the issue for me too.