Corona SDK support for Safari View Controller in iOS9

Apple said at WWDC last month that a big improvement in iOS9 would be the addition of the Safari View Controller, which kinda like Android lets developers open pages inside a Safari view:

Here are some details from a MacStories.net article:

“They’re positioning as the best way to open web views in apps… I expect that Safari View Controller will quickly become the de facto solution for in-app browsing, and that apps that continue to use hand-rolled web views will be rightfully viewed with skepticism… “I’ve already replaced Instapaper’s in-app browser with Safari View Controller”, Brian Donohue, lead developer of Instapaper for iOS, told me this week… “unless the app has a very good reason for not using it”, he expects to see Safari View Controller in most iOS apps “very soon””

I expect that Corona would not want its developers to become second-class citizens with hand-rolled web views! :slight_smile: Can someone from Corona comment on when support for Safari View Controller will be added?

It’s been over a week… Anyone?

We just found this thread today, perhaps after you bumped it and Brent has asked Engineering about this, but it was late on a Friday, so we may not get an answer for a while.

However, iOS 9 won’t be here for a couple of months and we are likely going to have to do a bunch to support it. This may be something for Enterprise/CoronaCards. It may be very easy or very hard to implement. Lets see what the engineers have to say.

Rob

Thanks, Rob. I just looked at some code samples and it seems trivial to implement on your end. One writeup, for instance, says it’s less than ten lines of code and gives examples:

The Safari view controller is incredibly easy to use. In fact, it’s one of the smallest APIs I’ve seen with only two initializers and two delegate methods. Even so, it brings all of the features users expect from Safari over to your app.

Being able to use the Safari view controller and toggle readability mode is, from my perspective, the most important feature Corona could implement for iOS in the next year.

It’s been three months since Safari view controller was announced and two months since this thread was started. 

Now that iOS 9 is out, it sure would be nice for Corona to support the controller – “incredibly easy to use” and “one of the smallest APIs I’ve seen” – in the very near future!

Hi @corona273,

Has there been a feedback topic filed for this? If not, can you start one?

feedback.coronalabs.com

Thanks,

Brent

Brent: Yes, it’s here:

http://feedback.coronalabs.com/forums/188732-corona-sdk-feature-requests-feedback/suggestions/9911013-adding-support-for-safari-view-controller-in-ios9

Though my sense is that the feedback forum is where good ideas go to languish. I can think of plenty of examples where Corona added features X, Y, and Z even though A, B, and C were top-ranked (though, to be sure, there are counterexamples as well).

Because this would be a trivial change on your part, as opposed to a major feature, perhaps you and your colleagues could find a few hours to implement it in the near future?

Of the 246 ideas, we have completed 90, started 6 and declined 18.  We have addressed 46% of the items posted to the feedback site.

The feedback site is not the only source of deciding what we will add. Also the number of votes is not the deciding factor either. At the end of the day:

o Some things are very hard, some things are very easy.

o Some things benefit a large swath of the community, some things only benefit a few.

o Some things are best done by us in the core, some things are best done by the community or the 3rd party it benefits.

We analyze all of this before we decide what to commit engineering resources to.

Rob

The current WebView in iOS has many restrictions which the Android WebView does not have. For this reason, for example, I cannot call up a video from the WebView browser, significantly impacting my App.

From analyzing above, it appears that implementing the new Safari WebView should require very little effort. I WILL ADD THE FEEDBACK that Corona requires to prioritize work. However, unless this is advertised properly to the community here online, I’m concerned that it will languish in priority. So PLEASE, do this soon!?

Rob: I think you’ve spent more time explaining The Process and The Procedure and The Priorities than it would take an engineer to implement those < 10 lines of code. If it were a major undertaking, sure, we understand. But < 10 lines of code? :slight_smile:

I know it’s not your decision, but remember we’re all developers here! 

Maybe we need to crowdfund this? I will pledge $100 in Bi-Rite Creamery ice cream (San Francisco’s finest) and other tasty treats to be delivered to Corona’s Palo Alto offices if this is implemented by the end of next week. Not joking, BTW. <troylyndon>, are you in?

Just to be clear, 10 lines of code is never 10 lines of code. Do we give you a new native.newSafariView()? Do we replace the code in native.newWebView()? What about for people who are not on iOS 9? Are events going to be call compatible?

Sure for a native iOS app if you want to add a UISafariViewController, it may be 10 lines, but when you’re trying to build a framework for everyone that’s cross platform then things are different. It’s not going to be 10 lines for us. We have to support more than a basic installation.

And finally, when Apple brings out a new OS, it’s in our best interest to wait until the OS stabilizes before we start trying to integrate it. First we work on new OS things that will break us (which is why we have to let Apple get their bugs out first) and prevent you from being able to build, then we go back and look at adding new features.

Rob: I understand from one of your colleagues that Corona has made some nice progress on this, so thank you.

Rob: Hey! I think this may be the first time Corona has ever been able to take me up on one of my Bi-Rite Creamery offers.

I posted on 9/25 that: “I will pledge $100 in Bi-Rite Creamery ice cream (San Francisco’s finest) and other tasty treats to be delivered to Corona’s Palo Alto offices if this is implemented by the end of next week. Not joking, BTW.”

Your colleague emailed me details on Friday 10/2, which seems to have satisfied my deadline.

Wow. It looks like I owe you folks some tasty snacks.

https://store.coronalabs.com/plugin/safari-view

https://docs.coronalabs.com/daily/plugin/CoronaProvider_native_popup_safariView/index.html

Rob, I’m in for $50 more of goodies for the Corona team. Just let me know the vendor, what you/they’d like, and I’ll order it up! We really are grateful for this new plug-in.

Troy: Too late! I placed the Amazingly Tasty SF Treat order last night and it will be arriving in the 11am-3pm window today.

Unfortunately there is a problem with Corona’s implementation of Safari View Controller affecting all apps that support rotation, which I posted about here: https://forums.coronalabs.com/topic/59577-safari-view/

 

Maybe you can send the next $50 of goodies once this is fixed. Keeps incentives aligned and all that. :slight_smile:

Treats arrived – thank you corona273!

Quite welcome! Glad they arrived safely (and without too much melting, I hope!).

I recall Rob works remotely so wasn’t able to join you but I did thank him on the card accompanying the delivery – mostly for putting up with my requests here for the last few years! (I wasn’t sure who was responsible for the Safari View Controller – maybe you? – so I wasn’t able to thank him or her directly.)

It’s been over a week… Anyone?

We just found this thread today, perhaps after you bumped it and Brent has asked Engineering about this, but it was late on a Friday, so we may not get an answer for a while.

However, iOS 9 won’t be here for a couple of months and we are likely going to have to do a bunch to support it. This may be something for Enterprise/CoronaCards. It may be very easy or very hard to implement. Lets see what the engineers have to say.

Rob