How can I reset iOS 9 Universal Linking settings? - ios

While testing universal links on my iOS 9 app, I accidentally tapped "mywebsite.com >" (top right corner). This made the app navigate to the website again. Now I can't seem to make universal linking work again. Seems like iOS has remembered my preference that I would like to see links opened in Safari as opposed to my app.
Has anyone run into this? Is there a way to reset this?

You can long-press on a universal link and it will give you an action sheet with an "Open in 'AppName'" option. Once you select that option it will default to opening the links in your app again.

You need pull down in opened page in safari from email, etc to see button "Open" (this button is system in safari). If tap "open" after
I accidentally tapped "mywebsite.com >"
universal link will work again under the old scheme.The result of this action preserves.
example

#dan is right, long-pressing the hyperlink will give you the option to open with your app again through universal link.
If you have an Apple Smart Banner in place, you can also click on its 'Open' hyperlink to active universal links on your app again.

For a Branch.io deep link the long tap (at least in GMail) does not work and also you can't pull down from safari, it brings you to the App Store immediately.
Instead, copy the link to Notes and then do the long press.
More info here: https://blog.branch.io/3-steps-to-troubleshoot-ios-9-and-ios-10-universal-links/

Related

iOS 9 Universal links Forward button breaks deep linking forever until I erase phone settings

Before anyone marks this question as a duplicate please read the extra section at the bottom that sites differences between this question and other similar questions out there
I'm utilizing Universal Links for my deep linking needs. Two example use cases are:
1.) Safari/Chrome Browser on iPhone with my app installed: When click on a link on my web site on their iPhone I'm deep linking them into my app if installed on their phone.
2.) With my app installed, running my app but using an in-app-UIWebView. My app also has an in-app UIWebView, when you tap a button it deep links them somewhere in the application.
After you deep link into the app, there are two buttons in the navigation bar. A Back button (top left) and a Forward button (top right).
My problem
If the user presses the forward button (top right) it forwards them to my web page and then will forever break my deep linking so that any time in the future when the user clicks on that link to deep link it always goes to my web page instead of deep linking into the app (which was the original intention). How can I prevent this? My concern here is that my app has close buttons in the top right corner and if the user is trying to hit hte close button they could accidentally hit the forward button and forever break deep linking. I've tried clearing my browsers caches, I've tried deleting and re-installing my app. But nothing will "fix" deep linking after it's been permanently disabled by the forward button. The only way I can get it working again is by doing a complete device reset and Erasing all Content and Settings.
Here is an image of the back and forward buttons after deep linking into the application.
Difference between my question and similar questions on SO:
Similar SO question But here they are saying that the user can long-press on the "universal link" and and action sheet pops up asking you to "open in ". I've tried this for above case 1.) and my app isn't showing up in the options. See attached screenshot below. And this doesn't work at all for above case 2.). How do you get a Universal link to work with an iOS WebViewController? Do I have to use the SafariViewController? I don't want to use SafariViewController in my app for this case because I don't want to have that top navigation bar that SafariViewController has.
You're absolutely right: the forward button is horrible UI/UX. It's one of the big flaws with Universal Links identified in this blog post. There is no way to disable the forward button, and once it's triggered, you're screwed.
The easiest way to re-enable Universal Linking behavior after it is turned off is to long-press on the link. But that doesn't work if your link is being disabled by the system based on some other criteria (more details below). Your best bet at getting a clean shot is to paste the Universal Link URL into the stock Notes app and try long-pressing it from there.
To answer a few of your other questions:
Universal Links do work within UIWebView (per Apple's docs). A SafariViewController is not necessary.
Universal Links are disabled at the system level in certain situations. There's a list here, but this the main one that comes to mind as potentially applicable in this situation:
Universal Links will not work with a user driven element click on the same domain. Example: if there is a Universal Link on google.com pointing to a different Universal Link on google.com, it will not open the app.
Your second example image is from Chrome. Universal Links should work (conditionally) in Chrome, but is the link pointing at the same domain as the page you've already loaded? If so, that's why you aren't seeing the Open in [app] option.
You cannot disable the button to open the website, but you can create a path in the other direction: Use a smart banner on the website, and when users tap "Open" (or the localized equivalent), they will be taken back to your app, and this will also reset the default to opening universal links in your app instead of Safari.

Deep linking broken after clicking the "Open in Safari" button

I just implemented iOS9 deep linking in my app and it was working just fine. Then I figured out that there is a "Open in Safari" button on the top right corner of the screen (opposite to the "Back to [App]" button).
I clicked it and now my links will always open directly in Safari instead of going into my app.
Can anybody else reproduce that? Is there a way to undo that? I searched inside Settings but can't find any appropriate options.
I found it. Just long-press the link and you will get the option to open it in your app again!

Open Safari to the last tab that was opened

Is it possible to open Safari from code that will reopen Safari with the last tab open? I've searched around and I can only find how to open Safari with a URL (not what I want) or open it to a blank page (also not what I want). Is it possible to reopen Safari in its last state?
e.g. someone is on Google on Safari. They then hide the app and launch my app. I'd like my app to open Safari and show Google - I don't want to use the delegate bundle passed in during activation as the website may be expired or dynamic and so I don't want to reload the page.
Thanks

apple-mobile-web-app-capable doesn't open in safari

Noticed this in iOS8 today and I'm not sure if this has always been the case or if it is something that's come in with iOS8.
My company's website, if I save the page to my home screen, adds the icon as expected. But when you open it, it doesn't open in safari, it opens as it's own standalone app. For example, double tapping the home button will show this app open, operating independently of safari.
I gather it has something to do with the apple-mobile-web-app-capable meta tag. Can anybody confirm if this is new or if it has always been the case. Also, some insight as to whether the above meta tag is actually responsible for this. Documentation specifies the default is to open in Safari.
Yes, the apple-mobile-web-app-capable meta tag will do this and it has been around for several iOS versions.
See more here:
https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html#//apple_ref/doc/uid/TP40002051-CH3-SW2

Add icon to home screen like Safari

I saw the Bug Me iPhone app and was intrigued by the ability to add icons to the home screen. I figured it would work similar to the way that Safari achieves it.
There as a similar question here that said it was not possible:
Implementing "Add to Home Screen", ala Safari
Clearly there is a way and I am not looking in the right places.
Has anyone else worked it out yet?
You have to use Safari.
BugMe saves the note on home screen by:
Upload the note to their server.
Launch Safari by -openURL: with a URL to their server.
In Safari, the user is instructed to press the "+" key to add a special bugme:// link to home screen.
There's no other ways if only documented methods can be used.
For private APIs, create a UIWebClip object and use -[UIApplication addWebClipToHomeScreen:].

Resources