forem / DEV-ios

DEV Community iOS App
GNU General Public License v3.0
357 stars 97 forks source link

Universal links not working when the app isn't installed #209

Open fdocr opened 4 years ago

fdocr commented 4 years ago

Describe the bug When browsing https://dev.to on a Safari (including embedded web views like Twitter's) we should see a banner at the top of the website that offers a deep-link towards for the iOS app (or a CTA for install).

Apple's validation tool shows the following error:

Screen Shot 2020-02-28 at 13 43 11

To Reproduce Steps to reproduce the behavior:

  1. Open Safari and go to 'https://dev.to'
  2. Click on any article
  3. The banner should be visible

Expected behavior A banner similar to the following should be visible:

IMG_0449

Screenshots The current way the website renders on Safari

IMG_8F547A43AFF1-1

Smartphone (please complete the following information):

joshpuetz commented 4 years ago

I can KINDA see it on iPad, but I have to scroll up then down: the pull to refresh interfere with it.

Also: this only happens when I have the DEV application already installed. Without the application installed, I never see a CTA to install it.

chickdan commented 4 years ago

Does the webserver have the apple-app-site-association file? It looks like the app has been configured to at least accept dev.to links to open the app. That said deep linking hasn't been setup yet so users may not be able to transition to specific pages. More information can be found here and here

This weekend I can work on accepting deep links.

fdocr commented 4 years ago

Thanks for the help Josh!

@chickdan thanks for offering to help! We do have apple-app-site-association setup though and deep linking seems to be working as well (when the app is installed).

Just like Josh commented: The banner appears to work when the App is installed (open an article using the Universal Links CTA) but not when the App is not installed (CTA that sends users to the App Store). The validation tool output does throw me off a bit.

We still haven't tested with a device using iOS 12.x to completely rule out it being a problem from Apple's end (iOS/Safari/etc). I also think this can be caused by the entitlements file within the project not being marked with "Target Membership" (sending in a PR soon just in case this is the reason we're seeing this bug).

fdocr commented 4 years ago

Reopening because we released 1.4.0 on Friday (more than 48h suggested by Apple's validation tool error message) and we still don't get the Universal Links Banner when the app is not installed.

I have other ideas we can implement to sort this out, which I hope to follow up with PR's soon. Open to hear & discuss suggestions to help fix this problem though 🙂

nemecek-filip commented 4 years ago

Hello, this is quite old doc - https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html but from googling I did it appears it is still relevant for the banner when app is not installed

fdocr commented 4 years ago

Hi @nemecek-filip, thanks for the suggestion and following up on the issue!

This could definitely be implemented on the main (web) repo fairly easy. I haven't tried it out or tested to see if it would interfere with the Universal Links (when the app is installed) though. But I took a look at Apple's WWDC site and it looks like that exactly what they use regardless of being a bit old!

We'll revisit this topic internally (for design purposes) because we tossed around an idea around of using a single web banner for both iOS & Android, similar but not exactly like how Instagram prompts the option to open the app when navigating on an embedded WebView (i.e. Twitter, Reddit, etc). If not moving forward with this I'd say we can definitely use the App Banner at least for when the App is not installed.