qamooos
qamooos

Reputation: 93

My app only work in background ios 10

I have ios app ( phonegap ) , the idea of my app to detect if there is headsrt , record and play audio , the problem of my app its only work in background .

When I click record button when the app in foreground , its did not do any thing , but when I press home button and go to back ground , every thing work .

Also I have put test button , when I click it , it should alert u with message , the message not appear only if I press home button and then come back to foreground .

Please note it was work perfectly in ios 9

But in ios 10 not work

Summary : The application only work if its in background , but in foreground not work ,.

Upvotes: 0

Views: 248

Answers (1)

DaveAlden
DaveAlden

Reputation: 30366

Your app is behaving like this because of the change in behaviour of the Content-Security-Policy meta tag in the iOS 10 UIWebView. One of the side effects is that plugin invocations are not executed until the app is put into the background (i.e. pressing the "Home" button).

You can resolve this by updating the Content-Security-Policy meta tag to add the gap:// protocol - see my answer to this question for details.

Upvotes: 2

Related Questions