1

I have a react-native app with multiple environments.

Dev, prod, ... Which means that I have multiple 'copies' of the app installed on the phone App Dev, App Prod.

These are under a different bundle identifier:

  • com.myapp.dev
  • com.myapp.prod

I use deep links to open the app, this works perfect on Android because it asks with which app you want to open it, but on iOS it just opens the first app that founds installed and i can't find the way to, for example:

  • Launch develop-app://whatever/1 and open it in the Dev app
  • Launch prod-app://whatever/1 and open it in the Prod app

What am i missing?

This are my defined url types:

enter image description here

Also the apple-app-site-association file looks like this:

{
    "applinks": {
        "apps": [],
        "details": [
            {
                "appID": "1234.com.myapp.dev",
                "paths": ["*"]
            },
            {
                "appID": "1234.com.myapp.prod",
                "paths": ["*"]
            }
        ]
    }
}

Update

  • The first problem that i found was that the apple-app-site-association wasn't using a Content-Type header, so, the app could not recognize the file.
  • The paths that each environment should recognize should be defined:
{
    "applinks": {
        "apps": [],
        "details": [
            {
                "appID": "1234.com.myapp.dev",
                "paths": ["/dev/*"]
            },
            {
                "appID": "1234.com.myapp.prod",
                "paths": ["/prod/*"]
            }
        ]
    }
}
  • Now i'm able to see the banner on the top of the website Open with App Dev as expected
  • 1
    Can you please share your `apple-app-site-association` file here? – HardikS Jan 08 '20 at 12:03
  • Great! So now your issue has been resolved, would you please take a moment & mark my answer as accepted & also upvote, so everyone who has the same issue can find it here? – HardikS Jan 09 '20 at 11:31

1 Answers1

0

You have to specify which path is to be opened by which app

For example, your domain is example.com

You have to specify a different path pattern for both dev & prod app in your apple-app-site-association file

For example, you can update your apple-app-site-association file as shown below

{
    "applinks": {
        "apps": [],
        "details": [
            {
                "appID": "1234.com.myapp.dev",
                "paths": ["/dev/*"]
            },
            {
                "appID": "1234.com.myapp.prod",
                "paths": ["/prod/*"]
            },
        ]
    }
}

Now, let us say you click on the urls below, you'll be directed to mentioned app in the comments

HardikS
  • 656
  • 3
  • 10