What could cause iOS Universal Links to stop working? - ios

I had Universal Links working on my iOS 9 app. If I clicked on a UL from an email or text message, it would launch my app as expected.
Then I added a QR Code Reader and used openURL() open the UL embedded in the QR Code from within my app (which was supposed to be handled by the app itself).
On one test run, the URL embedded in the QR code was malformed: it had a CR/LF at the end of it, and when the app tried to open it, it crashed (I do not have the crash log/trace unfortunately).
As I researched the crash I realized that openURL() is not designed to work with UL, so I fixed the code to have my app handle the URL differently, but now none of the ULs work with my app anymore: what used to work from an email or text message doesn't anymore (it launches Safari instead of my app).
I install my app via TestFlight and I can see from my backend that the apple-app-site-association file is being pulled, but it still won't work.
Important data (that's how I know the problem is with the state on that specific phone): the same app on a different phone opens ULs correctly.
It's as if the one bug I ran into put the phone in a state that will always launch Safari for those URLs no matter what.
It is the only phone that exhibits this problem.
What I tried without success:
uninstalling the app completely
reboot
Not sure what to try next. Thanks in advance for the help.

You probably clicked on the link in the top right corner of the status bar to open one of your ULs in Safari. After that all subsequent ULs will open in Safari.
In Safari, pull down the page until you see the Smart-App-Banner at the top. Then click on 'Open' and ULs should work again.

Related

iOS/Safari: "Back" button on FileDownload screen sometimes missing

Currently I'm facing a weird problem where I don't have any clue (because of this sorry for the very vague question). I've developed an Angular Web Application, that offers a file download. Now the weird part:
When testing on iOS (13.3, iPad, iPhone), basically everything is working. Then I did some variation of my test: I used the "Add to home screen" feature, where the web-app basically pretends to be a PWA, and iOS/Safari is opened without any browser UI.
In this mode, Safari handles file downloads a bit differently: When downloading a file, it shows a full-screen Overlay with the file name and some options, and some "Back/Done" button in the top bar (see screenshot below, where I download a test file "image.jpg").
The problem is that on some iOS devices on some test servers, exactly this button is missing in Safari, everything else is working.
Any idea what could trigger this behavior in iOS/Safari?
iOS PWAs have been really buggy with small issues like this because of certain new iOS features such as the Safari Download Manager in browser so Apple either hasn't realized or decided how they want to handle these bugs in PWAs.
I'd suggest to try out some different options to download your test files: https://forums.developer.apple.com/thread/95911

iOS deeplink works on one devices but not working on other

I've encountered a problem with deeplinks when testing them on several devices. I've found out that deeplinks works properly on ones of them(i.e. redirect to the app exactly) but on the others they redirect to AppStore.
I've read the Branch's troubleshooting guide about this issue(link below) saying that this problem may be caused by explicit prohibition of app links when pressing the button on the upper right corner of status bar.
And I've read that it can be fixed by long pressing the link from the Note app and then clicking "Open in App" button.
But the problem is that there is no such a button at all although the app is installed on device.
screenshot
P.s: I know that my universal links are fully configured and working because as I said deeplinks work properly on several devices and the same button(Open in App) appears in the Note app for these devices.
https://support.branch.io/support/solutions/articles/6000153326-ios-universal-links-troubleshooting-guide
I've found out the solution. When I add my URL scheme that I register on dashboard to my project's info.plist. I started being redirected correctly. But it didn't fix the issue with unemerging 'Open in app' button when long press link. And I cannot block app links. because there is no button in the status bar.
As for devices where deeplinks had worked initially they haven't broken. I still can block app links for these devices and 'Open in app' button appeares.
Amruta from Branch.io here:
If you are facing issues with Universal links configuration, our team has a validation tool that allows us to check various information about your Xcode project configuration to make sure everything is configured properly.
Once the configuration information is collected, the script sends it to Branch and returns a short-link you can follow to view the validation results. For exact instructions on running the script, I'd like to point you to the relevant docs page, found here:
https://dev.branch.io/getting-started/universal-linking-validator/
as well as the validator, which can be found here:
https://branch.io/resources/universal-links/
After running the local script, open the link in your web browser and enter your Branch Key and Secret to view the test results.
If you still continue to face issues I would suggest writing into integrations#branch.io and we'll walk through your integration with you!

Universal links (Deep linking) not working on iPhone but works on iPad

I am trying to build deep linking feature into my app. I did all the necessary set up for deep linking to work like, enabling associated domains in my app, adding apple-app-site-association to the root directory of my server, and I am serving a valid apple-app-site-association over https, I also validated my apple-app-site-association using this tool Validate your apple-app-site-association.
After doing everything right, I tested the deep linking feature on my iPad and it worked as expected. But when I tried to do the same on my iPhone it doesn't work, it always took me to safari. I tried it on 6s device, I reinstalled the app, I cleared Safari website data & cleared the history. Also updated the iPhone & iPad to iOS 9.3.5. The updating the OS didn't change a thing.
iPad still continue to work with deeplink URLs just like it did while it was on 9.3.4. iPhone still opened the link in safari.
Please give me some pointers on how to workaround this issue, I think this might be an apple bug but again I don't understand how it can work on iPad which is running same software as iPhone. Any help or guidelines is much appreciated.
Thanks.
I was able to fix this issue and this is one of the annoying issue that I have come across, because it doesn't say what is going wrong.
Fix: Whenever the iOS opens your link in safari, you need to pull down the webpage in safari and there you'll see a banner saying that, open it in the app. Once you click on that banner your future links will start opening the app instead of opening it in the safari browser.
There was no error whatsoever and there was no indication why the link was getting opened I am pretty sure that, iOS didn't download the apple-app-site-association whenever I installed the app.
Also note that the banner in the webpage will not be visible whenever your link opens up in safari, you need to pull down the webpage and then the banner will become visible and if you click on open in app banner, it will start opening the links in app.
If in future if you select to view the link in safari by clicking on context menu which appears on right hand side of the status bar, which will be saying "Open in [your app name]" in safari, the links in future will open in safari instead of app, and again if the banner open in app isn't visible, you have to pull down the webpage to see that banner.
HTH.
In iOS 13, similar problem of direct links not opening the app instead it open the safari website directly.
Fixed by updated the below safari setting...
Settings > Safari > Request Desktop Website > All websites > Switch Off
I was facing the same issue in iOS 12, on one device the link redirected to my app and on another device it was always redirecting to Safari and pressing the link on the Notes app was only allowing me to open it on Safari.
What I believe happened was that I pasted the URL in the browser and clicked Go, as I thought it would redirect to my app. No matter what I did ( reinstalling the app, restarting the device, ... ) the results were always the same, redirecting to Safari.
What helped me was deleting the cached data for my domain ( Settings -> Safari -> Advanced -> Website Data -> Swipe and delete the data for your domain ).
After that, everything started working.
I believe this is a bug with iOS Simulator,
In my case it was occurred when I entered an invalid address (with multiple spaces) for example:
Valid One: myApp://order/10003101
Invalid One: myApp://order/1003131
It stopped working even with Valid One and the solution was to clear Safari Website Data:
Go to Settings/Safari -> Clear History and Webstie Data
Device: iPhone 12 Pro Max
iOS: 14.5
Xcode: 12.5

Branch.io Deeplink not working in safari in ios 9, But it works in chrome

Deeplinks working perfectly when using chrome iOS app. But in safari it stopped working and it always redirect to the appstore page even the app is installed or sometimes pop a alert saying "safari cannot open the page because the address is invalid". Everything works perfect few days back. so my guess is this happens after the ios 9.2 update. Any solution for this?
UPDATE
I have tried using a new phone(Which app not installed before) and installed the app.
Deep links works for both browsers (Safari and Chrome).
If you push the bnc.lt forward button it opens App Store for both Safari and Chrome.
Next time you open a link deep link:
Safari: It asks if you want to open the link in app store
Chrome: It asks if you want to open app and at the same time redirects to app store. If you click open in app next time you click a deep link it will open in app.
So in other words you can still open the app from Chrome after clicking the bnc.lt forward link in staus bar. This is because Chrome asks for opening the app and not app store.
For Safari i end up in an irreversible state where the deep link always open app store and not the app.
Alex from Branch here: this is the expected behavior. Unfortunately our fallback options are rather limited at the moment, due to the changes to Universal Links in iOS 9.2.
TL;DR: it's a bit of an edge case that most users wouldn't encounter, but you can easily work around it by making use of our Deepviews functionality.
Basically, here's the logic behind what you're seeing:
When you open the link on a device without the app installed, you end up on our bnc.lt server, and we redirect you to the App Store so you can get the app. This is good.
When you open the link on a device with the app installed for the first time, your device detects the Universal Link and opens the app immediately. All this happens locally on your device, and you never even get to our bnc.lt server. This is also good.
When you push the bnc.lt forward button, you're telling your device 'I don't want you to immediately open the app...show me the web content for this link instead'. In the case of a Branch link, this 'web content' is simply a redirect to the App Store. At this point, Branch has no way to know whether you the app is installed or not, so we have to assume it isn't and you get the same treatment as 1. above. This is not so good, but right now we don't have any better options due to the way Apple has designed the system.
The next time you open a link, your device remembers that you pushed the bnc.lt button in the past and just takes you straight to the web content. I'm not sure why Safari does it this way, because I can't imagine many situations where this would be desirable and it is leading to a lot of confusion for users.
The real problem here is that when you press bnc.lt to bypass the app, your device remembers this preference and executes it every time it sees a bnc.lt link in future. Chrome still 'works' because it is proactively confirming the preference each time in 4., whereas Safari just plows forward. There are a few options for what happens next:
In Apple's ideal world, you'd end up on a normal webpage where you could simply scroll up and use the Open in app button to reverse this preference. But since Branch is immediately redirecting you to the App Store, this isn't an option. You could consider using our Deepviews feature, since this does provide some real web content in place of the immediate App Store redirect you're seeing right now.
In most situations, you can still long-press on the link and select Open in app, but this doesn't help users who don't know the option is there.
In the worst-case scenario, you end up on the App Store page and just press the Open button (instead of Install). Thanks to Branch's magic, you'll still end up in the right place!
Now from iOS 9.2, Apple no longer supports URI schemes for deep
linking, developers must implement Universal Links in order to deep
link properly on iOS.
Universal links let you replace custom URL schemes with standard HTTP or HTTPS links. Universal links work for all users: If users have your app installed, the link takes them directly into your app; if they don’t have your app installed, the link opens your website in Safari.
To learn all about universal links, see
How to support Universal Links in iOS App and setup server for it?
Example
https://github.com/vineetchoudhary/iOS-Universal-Links
UPDATE [1]
How Branch links work (Branch.io)
If you take a lock at fundamentals of Branch's contextual deep links. You found Branch.io also using traditional deep-linking
1. Creating links
When you’ve integrated the Mobile SDK, you can create a Branch link every time a user clicks to share or invite another user from within your app. Your app makes a call to Branch.io, and Branch.io return a Branch link.
2. Tying data to links
3. Clicking links
4. Using data
Check the Clicking links step, Branch.io just map your website URL with your app URI scheme but URI schemeno longer supported by Safari. So, move to Universal Links is only the option in order to deep linking in iOS 9.2 or you can wait for some solution by Branch.io. Thanks.

iOS URL scheme twitter://user?screen_name=SCREEN_NAME not working anyomre

I want to redirect the user of our iOS App to our Twitter profile page with the URL scheme:
twitter://user?screen_name=SCREEN_NAME
I recently noticed that this opens the Twitter app as expected but it shows a screen as if I used it for the first time:
The app is also completely frozen, I can't touch anything. If I keep the app open and klick on the UIButton in our app again, the profile will be shown correctly but still without being able to touch anything.
The only way I can get this to work is if I start the Twitter app before and let it open (in background). If I select the UIButton in our app now, everything works fine, the profile is shown and I'm able to interact with the Twitter app.
I think that there might be a problem of the Twitter app to handle such URL schemes on app start, but works when the app is already running.
Does anyone else experience this problem or have a solution for this issue?
Weirdly deleting and reinstalling the Twitter app fixed this problem. Still don't know why it happened though...

Resources