e-imaxina / cordova-plugin-deeplinks

Cordova plugin to support Universal/Deep Links for iOS/Android.
MIT License
33 stars 68 forks source link

Not working with localhost/local IP? #16

Open almercier opened 5 years ago

almercier commented 5 years ago

I cannot seem to get deeplinks to work when testing with a local IP server. It may be incorrectly configured, but I wasn't sure if there any known complications with doing this?

I have a node server running a self-signed cert that is trusted on my devices, and I verified that https://192.168.0.1:8080 does return my website with a validated certificate.

I have assetLinks.json and apple-app-site-association duplicated and accessible from both the https://192.168.0.1:8080/ root directory and the https://192.168.0.1:8080/.well-known/ directory just to be sure. I verified that both get sent/received as expected with a 200 OK status. (192.168.0.1 is just a dummy IP as I did not want to put my actual IP). I verified that the bundle profile in the apple.developer portal has "Associated Domains" enabled.

apple-app-site-association (anything in <> is replaced with our information which is intentionally redacted)

{ 
  "webcredentials":{ 
    "apps":[ 
      "<teamid>.<bundleID>"
    ]
  },
  "applinks":{ 
    "apps":[],
    "details":[ 
      { 
        "appID":"<teamid>.<bundleID>",
        "paths":["*"]
      }
    ]
  }
}

assetLinks.json

[ 
  { 
    "relation":[ 
      "delegate_permission/common.handle_all_urls"
    ],
    "target":{ 
      "namespace":"android_app",
      "package_name":"<bundleID>",
      "sha256_cert_fingerprints":[ 
        "<keystore sha256 hash>"
      ]
    }
  }
]

I'm running the lastest cordova-ios 5.0.1, cordova-js 5.0.0, and cordova-android 8.1.0 versions. Building with xCode 11.1 and Android Studio (latest version) for iOS 13.1 and android 9. In my cordova config I have

<?xml version='1.0' encoding='utf-8'?>
<widget id="<bundleID>"...>
    ....
    <plugin name="cordova-plugin-deeplinks" />
    <universal-links>
        <host name="192.168.0.1:8080" scheme="https"/>
        <host name="localhost:8080" scheme="https"/>
    </universal-links>
</widget>

I built both an iOS enterprise distribution and signed android APK, installed them on my devices, and verified that both apps are running the website from my local server. However when I click the link https://192.168.0.1:8080/ on either device in the native browser's URL field, native mail client, slack, etc I go directly to the website in the browser and do not get prompted or redirected to the application.

Is there something I'm doing incorrectly, or is it not possible to get deeplinks to work through a local IP server?