Open in [MyAppName] from WKWebView - ios

Can I achieve the Open in [MyAppName] banner using a WKWebView?
Open in MyAppName
I have submitted an app [written in Swift] which prompts the user to sign in to a google account through Safari and open a .csv file of a report. When the report is opened the user is presented with the Open in [MyAppName] banner. They click it, the app launches with the contents of the URL and it all works perfectly.
Apple have rejected the app saying that navigating the user to Safari is a 'poor user experience' and suggest I use a Safari View Controller. As this is available for iOS9+ and I want to target iOS8+ I am looking to use a WKWebView but I can't seem to get the Open in [MyAppName] banner to appear. I'm not aware that this functionality is even possible with WKWebView.
I've messaged Apple to ask them but I find them so slow to reply.
Thanks in advance
Steve

Related

How to force to open app by Universal Link in Swift likes iOS Notes app

I run into an issue with Universal Link that once the Universal Link is opened by Safari, it won't able to open by its app.
Seem iOS does remember the last app used to open the link.
But when I copy the link into iOS Notes app, long-press, select Open in "App Name" and the issue is gone! (Check the screenshot)
Does anybody know how to force to open an app like iOS Notes app?
Or does anybody know how to check whether the URL has been remembered to open by Safari by iOS?
I did try by open(_:options:completionHandler:) & specific options [.universalLinksOnly: true] but it doesn't work
Thanks all 🙏🏿
This article may help.
When a user browses your website in Safari and taps a universal link in the same domain, the system opens that link in Safari, respecting the user’s most likely intent to continue within the browser. If the user taps a universal link in a different domain, the system opens the link in your app.

iOS 9 Universal Links not launching the app from the same domain

I have setup my AASA JSON file to open the app when someone visits myDomain.com/ShowInTheApp/*
This works from Notes App, Email, Gmail App, Gmail web on safari and basically any other websites other myDomain.com .
When myDomain.com/chooseAppORweb.html contains a link to myDomain.com/ShowInTheApp/ , safari always opens it in the same tab, app wont get launched. I can tap and hold the link to show the context menu that contains an entry "Open In [My app name]" which will indeed launch my app. But not by single tapping on the link.
When I do the exact same steps from another domain, NOTmyDomain.com/chooseAppORweb.html always launches the app without issues.
Has anyone succeeded in launching the app consistently from the same domain using UL ?
Also, if there is an Apple's document that explains any of these behaviours, please share the link.
I'm not sure when Apple added this to their documentation, but it's explained on their Support Universal Links page, in the first note:
In iOS 9 and later, universal links let users open your app when they tap links to your website within WKWebView and UIWebView views and Safari pages, in addition to links that result in a call to openURL:, such as those that occur in Mail, Messages, and other apps.
When a user is browsing your website in Safari and they tap a universal link to a URL in the same domain as the current webpage, iOS respects the user’s most likely intent and opens the link in Safari. If the user taps a universal link to a URL in a different domain, iOS opens the link in your app.
For users who are running versions of iOS earlier than 9.0, tapping a universal link to your website opens the link in Safari.
(Emphasis added)
Essentially, once a user reaches a page hosted on your domain in Safari, any links they follow on your domain will be opened in Safari, even if they're defined as Universal Links by your app.
As st.derrick mentioned above, this is the in-place behavior for Universal links. If you have previously been taken to the App from the link, but then choose to be taken to the website when prompted with a long press, the functionality to open the App will break. You can remedy this by long-pressing again and choosing to open in-app. It's not an ideal solution, but it is the only way I've seen it be fixed. I hope this helps!

Opening iOS Passbook app from iOS Safari

I have a website where I offer to Download a Pass to Passbook.
After clicking on it on an Iphone the pass opens up and lets me save it to Passbook. After I click on add I am again on the previous Safari website.
Is there any chance I can then open the Passbook App programatically from Safari? Some kind of URL scheme?
Similar to this one here?
https://developer.apple.com/library/ios/featuredarticles/iPhoneURLScheme_Reference/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007899-CH1-SW1

iOS direct install from within an app

I just clicked on an ad banner in an iOS app. An interstitial (a layer above the actual app) opened and I was able to install the app without being redirected to the app store. This is what happened:
Click on banner ad
Interstitial opens full screen
I clicked a button with "Play now" on it (on the interstitial)
I was not redirected to the app store but was able to use touch id in order to directly download the app from within the interstitial
I have two questions regarding this user experience:
How is this done?
Is this also possible from within safari or a webpage in general.
Take a look at the SKStoreProductViewController
No, but you can link to the page on the app store and it should automatically open in the App Store app if running on an iOS device. I suppose one could also implement a browser that redirects app store links to a SKStoreProductViewControoller.

Click on a posted news-feed Facebook will open up my iOS app on iOS 7

I have an app on iPhone, that share a message on Facebook news-feed. It's ok. But when i open the Facebook app on the iPhone, and click on what i have shared in news-feed, it open up to my application !!?? it should open the link i have shared on Browser. My iPhone run iOS 7.0.3. In iOS 6 it's seem ok.
Does anyone deal with this problem?
Thanks.
Take a look at this. section - "Communicating with other apps".
Basically, you would implement a custom url scheme for your app and when a link with your url scheme is invoked, iOS sends a message to your app to invoke itself.
I have found that the "Deep linking" in setting of the Facebook app on my account determines the behaviour when click on the shared link (on iPhone). If i turn off "Deep linking", it will be ok.
But now the problem is the text header of shared item is:
" shared a link via "
while i see some application such as Vine show on news-feed:
""
(Although Vine only shares a video link, not post video to Facebook).

Resources