简体   繁体   中英

IONIC : Open web links in mobile app

I have an IONIC app. I want my users to share links with https:// or http://. Should open in my native app. If app not installed should ask me to install it from the play store.

I tried this https://github.com/EddyVerbruggen/Custom-URL-scheme

But nothing happen when I click on https:// url. It still opening in my chrome browser. It should as me to open link in my app only.

I want exactly same explained here : https://paul.kinlan.me/deep-app-linking-on-android-and-chrome/

Eddy's plugin is specifically for a custom URI scheme . This is the myapp:// format you're seeing, and as you noted, it doesn't allow http:// or https:// links.

Paul works with the Chrome team, so his article is specifically about Chrome Intents. This is a nice standard, but only works on Chrome and isn't particularly useful if you want compatibility anywhere else.

The App Links standard is designed to solve this issue, but it's only supported on newer versions of Android.

Instead, what you need is hosted deep links . With this set up, your https:// URLs lead to webpages that redirect to your custom URI scheme, which opens the app and deep links your user. You can technically build it yourself, but most developers don't. Services like Branch.io (full disclosure: I'm on the Branch team) and Firebase Dynamic Links make the process much easier.

Here's a breakdown of the various deep linking options for Ionic: https://blog.branch.io/how-to-deep-link-in-cordova-phonegap-and-ionic/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM