1

I built a simple app using Expo, and have installed "stand-alone" builds on iOS and android devices.

The app has a custom scheme "myapp://". On iOS, I can open a browser window, type "myapp://" in the url and hit enter, and I'm asked whether I want to open my app.

I'd like to replicate this behavior on the default Android browser (Chrome). When I enter "myapp://" in a Chrome browser on the Android device, however, I'm not prompted to open the app. By contrast, when I enter "myapp://" in a Firefox browser on my Android, my app loads.

Does anyone know what the url scheme should be such that Android will open the app with the scheme "myapp://" when using Chrome? I'm happy to provide any other information that would be helpful.

Some additional details. My expo app.json contains:

"android": {
  "package": "com.myapp.app",
  "intentFilters": [
    {
      "action": "VIEW",
      "data": [
        {
          "scheme": "https",
          "host": "*.myhost.com",
          "pathPrefix": "/*"
        },
      ],
      "category": [
        "BROWSABLE",
        "DEFAULT"
      ]
    }
  ]
},

https://myhost.com/linking.html contains a link that looks like:

<a href='intent:#Intent;scheme=myapp://;package=com.myapp.app;end'>Deeplink</a>

When I click that link at that address in Chrome on Android, I'm successfully navigated to the app. I'd like to make this process automatic though, so users are sent into the app upon arrival at myhost.com/linking.html without having to click anything...

Chrome version: 80.0.3987.132
Operating system: Android 9
duhaime
  • 25,611
  • 17
  • 169
  • 224

1 Answers1

0

Android supports deep linking as well. You can actually start an app on android on opening a specific url which is pretty straight forward to implement. More about deep linking on android and a shortcut with link assistant with link assistant.

Murmeltier
  • 595
  • 5
  • 10
  • I'm using expo though, which means I don't have direct access to the underlying Java of the Android app, which seems to be required in these links... – duhaime Mar 28 '20 at 19:35
  • Well that's mean... Ok expo docs says it should be possible too. https://docs.expo.io/versions/latest/workflow/linking/#linking-module – Murmeltier Mar 28 '20 at 19:39
  • 2
    it turns out the deeplinking issue is only present in Chrome, not Firefox (see edits to question). If you have any idea why this might be, I'd be grateful for your thoughts! – duhaime Mar 29 '20 at 18:02
  • Damn I can relate to that! If you are going to release an app make sure to test built apk and ipa. I once had an issue with the date in javascript which worked just fine on both emulators and android device but for some reason it refused to work on iOS device after compiling an ipa. Why can it be? It might be a reactjs issue because both browsers use different engines and it is possible that chrome is a bit more restrictive to some react processes. I wonder what's going to happen if you debug it on safari. – Murmeltier Mar 29 '20 at 20:01