Search code examples
react-nativeexpodeep-linking

deep-linking not working after the app on production


I created my app with react-native expo and added deep-linking and I tested the deep-linking on develop and on simulator and it is working fine "npx uri-scheme open myapp://orders --android" but when try to open this "https://myschema.com/orders" on my android device through chrome not open the app the app.json is

{
   "expo":{
      "scheme": "myapp",
      "android": {
          //........
          "intentFilters": [
             {
               "action": "VIEW",
               "autoVerify": true,
               "data": [
                  {
                    "scheme": "https",
                    "host": "myapp.com",
                    "pathPrefix": "/"
                  }
                ],
              "category": [
                 "BROWSABLE",
                 "DEFAULT"
               ]
            }
         ]
      }
    }
}

Solution

  • Add this for test ios

    {
       "scheme": "myapp",
       "host": "*",
       "pathPrefix": "/"
     }
    

    Your new code will be like:

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

    ios => after build ipa for test ios run this link in your browser phone when app installed : myapp://

    android => after build apk for test android send in this link in message (email , whatsapp, ...) and click link for test (after installed app)