Is Deeplinking with Ionic supported?


#1

Our current cordova angular 1 app has deep linking. All the asset files and stuff are already setup.
One of our apps just opens the app if a link is clicked.
Another of our apps does actually try to route to a page in our app.

Ionic seems like it had a plugin but its not maintained and left Branch.io to do it. Seems like you have to pay for that?

Does Ionic still support deeplinking without branch.io plugin?
The easy app is really just config.xml settings but also setting up the mobile linking/permissions.


#2

See: https://github.com/ionic-team/ionic-conference-app/blob/master/src/app/app.module.ts


#3

#4

I guess thanks for trying to answer the question?
@robinyo What is that link?

@Heenavora I know Branch.Io does deep linking that is what my post was about. Is that that ONLY way to do cordova deep linking? Don’t you have to pay for that?


#5

Till 10’000 clicks a month, branch.io is free (https://branch.io/pricing/)

There was another plugin, so far I know, but it was deprecated and therefore I switched to branch.io too


#6

It’s built into Ionic Native, no need to use branch.io at all

import { Deeplinks } from ‘ionic-native’;

Deeplinks.route(deeplinkRoutes).subscribe((match) => {
console.log(match);
if (match.$route) {
this.deeplinkRoute = match.$route;
this.deeplinkArgs = match.$args;
}
else {
this.nav.push(DeeplinkErrorPage, { deeplink: JSON.stringify(match) });
}
}, (unmatch) => {
console.log(unmatch);
this.nav.push(DeeplinkErrorPage, { deeplink: JSON.stringify(unmatch) });
});


#7

Follow this link


#8

Even with ionic-native you would need a plugin behind. Furthermore, that’s exactly the plugin which isn’t maintained anymore


#9

I would think some type of cordova plug needs to be installed.

Old way with just cordova it added this.

 <universal-links>
        <ios-team-id value="239LKJLJK88" />
        <host name="www.example.com" scheme="https">
            <path event="" url="/link/Check/*" />
        </host>
    </universal-links>

We would give the user a URL with /link/Check in it. If that was clicked then the app would open. If the app isn’t downloaded we had a file at that url that would redirect to the correct app store.

I don’t see how the Ionic old plugin does any of this?
Installing the ionic deep link plugin.
The Ionic plugin add this to config.xml

 <plugin name="ionic-plugin-deeplinks" spec="~1.0.15">
        <variable name="URL_SCHEME" value="nothing" />
        <variable name="DEEPLINK_SCHEME" value="https" />
        <variable name="DEEPLINK_HOST" value="www.example.com" />
        <variable name="ANDROID_PATH_PREFIX" value="/" />
        <variable name="ANDROID_2_PATH_PREFIX" value="/" />
        <variable name="ANDROID_3_PATH_PREFIX" value="/" />
        <variable name="ANDROID_4_PATH_PREFIX" value="/" />
        <variable name="ANDROID_5_PATH_PREFIX" value="/" />
        <variable name="DEEPLINK_2_SCHEME" value=" " />
        <variable name="DEEPLINK_2_HOST" value=" " />
        <variable name="DEEPLINK_3_SCHEME" value=" " />
        <variable name="DEEPLINK_3_HOST" value=" " />
        <variable name="DEEPLINK_4_SCHEME" value=" " />
        <variable name="DEEPLINK_4_HOST" value=" " />
        <variable name="DEEPLINK_5_SCHEME" value=" " />
        <variable name="DEEPLINK_5_HOST" value=" " />
    </plugin>

I don’t think URL schemes are supported anymore so that is why I put nothing there

I don’t see how to get this setup to be like the cordova way???
How to set up Ios Universal links. Are those not supported?


#10

This is the cordova plugin we were using.

I don’t know how hard it is to convert this to work with Ionic (Ionic Native). I don’t know if there is some walkthrough or guide on how to I guess wrap a cordova plugin to work with Ionic?


#11

Using the old ionic plugin doesn’t seem to work for our needs.

For Android I guess because its doing things the old way, clicking a link the user is prompted if they want to go to the app or to a web page. The Universal Link cordova plugin doesn’t do this it takes the user straight to the app.

For Apple I can’t get this working at all. Mostly because Universal Links now need the App ID of the app (like I show in the config.xml above). Clicking the deep link on the iphone just follows the links and takes the user to app store. Does not take it the user to the app I have pushed to the phone.

Options. 1. Get the cordova-universal-links-plugin working.
Option 2. rely on a third party site to get this working. (shame on Ionic for pushing people this way).


#12

on the other side why reinventing the wheel? branch.io does a really great job and offer a free model till 10’000 clicks/month. what would be the win there?

there is also an option 3: create your own deep-linking library or fork an existing one and develop it further


#13

Option 3 is really option 1 getting it working with ionic. I would love to do that, but no time right now.

I do see your point. I can see if people are starting from scratch branch.io can make it easier.
When there are already existing cordova plugins that work. I would think keeping that option available would be helpful also.


#14

It’s bad strategy to rely on Cordova plugins. A lot of smart people put a lot of work into them, but they are a tool that is fading away. Learn techniques of the future.


#15

That is the whole point on why I didn’t want to use branch.io. Just another layer to rely on.
Then again the whole point of Ionic is relying on these plugins.


#16

I having bad experience now too.

in android, even though i use ionic-deeplink,

code start is working but once the app is opened, it can’t detect the match changed.

some of ppl said ngzone inside of subscribe works. but it is not working!..

maybe i will use branch io too. i saw many people just go for there too.