iOS 10 Strange Problem


#1

Hi
I have a strange Problem using ionic on iOS 10. On iOS 9 all work like it should. And while I used the beta of xCode 8 it also worked on iOS 10 Beta. Since I have installed xCode 8 from App Store and build the app using ‘ionic build ios’ it will not work right on iOS 10.
The App starts like expected, but the .run method is not fired, or hangs. When I double tap on home-button to switch between apps, the it is fired and I get the Question for Push Notification. The same is when I go to my map, the question for location usage also shows when I want to switch apps, but not before. This is on each start of the app, that these functions aren’t called right.
Like I said, the same code and the same build works just fine on iOS 9.
Am I missing something that is different in iOS 10? The privacy entries I have made in the plist file.


#2

After long time of searching I have found the issue. In the Content-Security-Policy Settings I had to add gap: and other things to ensure the app runs normal.


#3

thanks, this actually helped me quite a bit. I found some very odd behaviors in the app: missing content, vibration did not work, sound did not work, call number did not work, etc. Only thing that I wished you would have done was include the CSP string :slight_smile: since most of it is gibberish to me. The one I found and started using is "img-src * ‘self’ data:; default-src * ‘self’ gap: ; style-src ‘self’ ‘unsafe-inline’; script-src ‘self’ ‘unsafe-inline’ ‘unsafe-eval’; ". Everything vastly improved after that. Yay! Now if I can just get the remote notifications to work again which I am hopeful that it’ll be a much easier task.


#4

Thanks rkreienbuehl, mentioning gap: in the Content-Security-Policy of my index.html fixed my Ionic 1 app for iOS 10!


#5

I thank Servian much … even I have the proble m inthe push notifications someone could solve ios push notifications in 10 normal ios I work 9


#6

Hi! Can you post an example of what you added? I mean the Content-Security-Policy, it would help me a lot, thanks!


#7

Enable push in xcode and that fixed the push for me on iOS 10 devices.

Under: Capabilities tab > Push Notifications in Xcode.