[TIMOB-19020] iOS 9: Support SFSafariViewController
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-07-14T02:59:31.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 5.1.0 |
Components | iOS |
Labels | iOS9 |
Reporter | Fokke Zandbergen |
Assignee | Chee Kiat Ng |
Created | 2015-06-15T08:35:17.000+0000 |
Updated | 2015-10-22T22:05:03.000+0000 |
Description
iOS9 comes with a new SFSafariViewController to display a modal version of Safari with a return button to close it. We should probably use this in
openURL
, maybe as an option so developers can still choose to open in Safari like it does now.
{quote}You can use SFSafariViewController to display web content within your app. The Safari View Controller shares cookies and other website data with Safari, and has many of Safari's features, like Safari AutoFill and Safari Reader. Unlike Safari itself, the Safari View Controller UI is tailored for displaying a single page, featuring a Done button that'll take users right back where they were in your app.
Consider replacing your WKWebView or UIWebView-based browsers with SFSafariViewController if your app displays web content but does not customize that content.{quote}
https://developer.apple.com/library/safari/releasenotes/General/WhatsNewInSafari/Articles/Safari_9.html
Would recommend against changing the behavior of openUrl as it has a specific meaning in the underlying platform's framework. The SFViewController is pretty self containing making it an excellent candidate for a module ( https://github.com/benbahrenburg/Ti.SafariViewController ).
[~ben.bahrenburg@gmail.com], Do you have a sample code for the use of the module? Thanks.
Hi [~cng] I'm putting together sample code, and the yaml documentation. Should be ready in the next two days. Figure at that point can transfer over to AppC-Modules.
Reviewed and tested. Approved! Will be transferring into AppC-Modules.
Really a minor thing, but could we normalize the events "opened" and "closed" of the viewController to "open" and "close"? Benefit would be, that it is a familiar behavior to
Ti.UI.Window
which developers already know.[~hansknoechel], can you do a PR for that? https://github.com/appcelerator-modules/Ti.SafariDialog After which, also do a PR for master to place this module in
only difference is these events happen after the fact, which is why they are in the past tenses.
PR: https://github.com/appcelerator-modules/Ti.SafariDialog/pull/1 [~ben.bahrenburg@gmail.com] That ok for you?
PR to ship the module with Titanium SDK: https://github.com/appcelerator/titanium_mobile/pull/7200
I found a little bug in the module. Should I create a new JIRA issue?
yes please. thanks!
Verified fixed, using the example code provided, am able to use the new
SFSafariViewController
without issue. Tested on iOS 9.1 device and Simulator. Mac OSX El Capitan 10.11 (15A284) Studio: 4.3.3.201510201834 Ti SDK: 5.1.0.v20151021165224 Appc NPM: 4.2.1-6 Appc CLI: 5.2.0-24 Ti CLI: 5.0.4 Xcode 7.1(7B91b) Node v4.2.1 production *Closing ticket.*