[TIMOB-17641] iOS8: Add UIApplicationOpenSettingsURLString Support
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-09-15T16:10:50.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 3.4.0, Release 3.5.0 |
Components | iOS |
Labels | ios8 |
Reporter | Ben Bahrenburg |
Assignee | Jon Alter |
Created | 2014-09-03T23:30:39.000+0000 |
Updated | 2015-05-06T20:18:27.000+0000 |
Description
Add a property to return the application setting URL on iOS 8 so that we can use Ti.Platform.openURL to launch directly into that screen.
For example:
var settingsURL = Ti.App.iOS.ApplicationOpenSettingsURL;
if(settingsURL != undefined) {
if(Ti.Platform.canOpenURL(settingsURL)) {
Ti.Platform.openURL(settingsURL);
} else {
alert('cannot open URL');
}
}
Added pull request https://github.com/appcelerator/titanium_mobile/pull/6017 Ingo mentioned AppC is now taking iOS8 PR. This ticket was created in associated with PR 6017.
[~mpmiranda], for iOS 8 tickets, add a label of "ios8" and make sure the summary _starts_ with iOS8 (no spaces)
How to test: 1. Using a Ti SDK with this PR included create a Titanium app. 2. Select iOS8 as the target. 3. Copy the below into the app.js
4. Press the button, you should then be taken to the privacy settings for your app 5. Close simulator or remove app from device 6. Update your Titanium test project to target iOS7 7. Launch in simulator or push to device 8. Press the test button, you should now get a message stating that ApplicationOpenSettingsURL is undefined. This is due to iOS7 not supporting this property.
Can you take a look?
PR master: https://github.com/appcelerator/titanium_mobile/pull/6060 PR 3_4_X: https://github.com/appcelerator/titanium_mobile/pull/6061
Using Ben's code, the settingsURL is undefined even for iOS SDK 8 target. Tested On: SDK: 3.4.0.v20140913174915 Studio: 3.4.0.201409131030 CLI: 3.4.0-rc3 Alloy: 1.5.0-rc2 Xcode: Xcode 6 GM seed Device: iPhone 5s (v8.0 GM)
Ben's sample code has to be updated, Application should be small 'a' in Ti.App.iOS.applicationOpenSettingsURL. Please use this instead.
The Ti.App.iOS.ApplicationOpenSettingsURL works as expected. Tested using the updated code and instruction mentioned by Ben. Tested On: SDK: 3.4.0.v20140913174915 Studio: 3.4.0.201409131030 CLI: 3.4.0-rc3 Alloy: 1.5.0-rc2 Xcode: Xcode 6 GM seed
Hello, Using the provided code enables me to open the APP'S SETTINGS - just like documentation says: _Returns a URL to open the app's settings._ The problem is that this is not the most common behavior if you're trying to turn LOCATION SERVICES back on, for example, using the current method you'll need to go back from the App's settings into -> Select Privacy -> Select Location services. This is horrible from the user's point of view, because he/she might try to enable Location services from within the app's settings, but if it was turned off from the privacy page, iOS won't allow the user to change it back on (hence the above path is needed). That being said, pretty much all the apps that depend on Location Services (Hotel Tonight, Foursquare, Dojo, etc.) are able to launch the Location Services page (Child of Privacy) DIRECTLY. My question is: Is it possible to open the settings page directly with this String? If Not, shouldn't there be another string for it? Thanks a lot - I know it's a little out of ordinary to ask questions here, but this might also be a bug, since from a quick research the apps used the same exact string for a different behavior in Objective-C.