guyromb / cordova-open-native-settings

Plugin to open native screens of iOS/android settings (maintained, end-2020)
http://gsrweb.net
MIT License
113 stars 107 forks source link

Added iOS 10 support #5

Closed yazantahhan closed 7 years ago

yazantahhan commented 7 years ago

First Apple Review Team rejected my app and wrote that:

"Your app uses the "prefs:root=" non-public URL scheme, which is a private entity. "

But I've explained that the app only uses a public API:

    NSURL *appSettings = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
    [[UIApplication sharedApplication] openURL:appSettings];

and they confirmed that my app is conforming their regulations. So I've succesfully passed a review.

yazantahhan commented 7 years ago

As Apple removed the support of redirecting user programmatically to settings page using "prefs" prefix in iOS 10, it is now supported using "App-Prefs".

What I did: 1) Added macro in header file that checks the iOS version - Credits to yasirmturk 2) Added a variable "prefix" which by default has the value of "App-Prefs" which is supported in iOS 10. After that, it checks the version of iOS if it is less than 10 then the prefix is "prefs". Then added the prefix and concatenated with the remaining strings.

yazantahhan commented 7 years ago

@guyromb I have tested it to open the WiFi settings on iOS 10 on a real device and on iOS 8 on simulator. However, the simulator doesn't have a WiFi settings so it redirected me to the general settings page. Could you please test it on real device if you have one just to make sure that everything is working? Thanks

guyromb commented 7 years ago

Yes. Thanks!

emcniece commented 7 years ago

@yazantahhan just confirming that iOS 10 operation is working fine, and we passed the Apple Review process this week!