Ionic-plugin-deeplinks unsubscribe when path unmatched


#1

Hello

I have been using ionic-plugin-deeplinks and I have seen the following behavior:

When an unmatched route is triggered, then the plugin stops triggering the subscribed functions on matched routes that may trigger next.

for example:

    this.eventSubscription=this.deeplinks.route(this.routes)
      .subscribe(
        (match)=>{ this.onDeepLinkMatch(match) },
        (nomatch)=>{ this.onDeepLinkNoMatch(nomatch) }
      );

If the onDeepLinkNoMatch() called once, then both of my onDeepLink… functions do not trigger.
The deeplink is captured because I can see in the console:

On deep link 
Object {url: ...

The only way to bypass this, is to re-subscribe when the onDeepLinkNoMatch() is called.

But then, I’m starting seeing two console.log entries of ‘On deep link…’ messages.
If another unmatched deeplink occurs, and I subscribe again, then I see 3 ‘On deep link…’ messages in console.log. And so on.

Using

this.eventSubscription.unsubscribe();

before subscribing anew, does not help.

Is the team aware of this behavior?
Or am I doing something wrong?

Thank you
Costas


#2

Hello killerchip!

I stunned with the same issue, did you find how to fix it?

Thank you for help!


#3

Agree with @killerchip, I faced that this week too, I think it’s an issue (on my comment at the bottom I tried to link the possible duplicated issues):

As you, the only workaround I found so fat was subscribing again when there is a nomatch


#4

Eventually, I dropped using the ionic’s deeplinks, and started using

It’s free for the “Quick links” aka deeplinks, and also provide support for redirecting to AppStore, Google Play, when the app is not installed.


#5

Please , can you provide a code example on how you implemented in your ionic 3 project .
Thanks


#6

Hello

If you are referring to my post, here’s branch’s doc for Cordova, ionic projects:

https://docs.branch.io/pages/apps/cordova-phonegap-ionic/


#7

@killerchip it was maybe a clever move, ionic-plugin-deeplinks has been now marked as “NO LONGER MAINTAINED” with branch.io as recommended solution