镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content
This repository was archived by the owner on Aug 17, 2023. It is now read-only.
This repository was archived by the owner on Aug 17, 2023. It is now read-only.

match and no match never fire #245

Open

Description

@mah-qurashy

I'm trying to use this plugin to setup deep links on my android app, here's my code, in app.component.ts

ngAfterViewInit() {
  this.platform.ready().then(() => {
    this.deeplinks
        .route({
          '/secondaryLogin/:id': 'secondaryLogin',
          '/userinfo/:id': 'userinfo',
        })
        .subscribe((match) => {
          this.toastr.success('deeplink matched' + JSON.stringify(match));
          const internalPath = `/${match.$route}/${match.$args['id']}`;
          // Run the navigation in the Angular zone
          this.zone.run(
            () => {
                this.router.navigateByUrl(internalPath);
            },
            (nomatch) => {
              // nomatch.$link - the full link data
              this.toastr.error(
                "Got a deeplink that didn't match" + JSON.stringify(nomatch)
              );
            }
          );
        });
  });
}

On clicking a link, the match and no match functions are never called, I'm not getting any toasters, the app opens to the home page and does not navigate.

Activity

  1. kaililleby commented on Jun 11, 2021

    @kaililleby

    To me it seems that the following commit bdd2d91 introduces an error in deeplink.js.
    The change from self.routeMatch(targetPath, realPath) to self.routeMatch(pathData, realPath) makes no sense - pathData is an object and will make the call to self.routeMatch(..) to throw an exception

  2. kaililleby commented on Jun 11, 2021

    @kaililleby

    @elylucas perhaps you could verify that the change in bdd2d91 is the cause of this problem?

  3. mah-qurashy commented on Jul 25, 2021

    @mah-qurashy
    Author

    It seems because there is no .subscribe method chained to .route. Instead it takes three arguments where the last two arguments should be those of the .route method. Most likely a duplicate of #148

    tested with passing match and nomatch functions directly to .route, still having same issue, they do not fire

  4. mah-qurashy commented on Nov 19, 2021

    @mah-qurashy
    Author

    To me it seems that the following commit bdd2d91 introduces an error in deeplink.js. The change from self.routeMatch(targetPath, realPath) to self.routeMatch(pathData, realPath) makes no sense - pathData is an object and will make the call to self.routeMatch(..) to throw an exception

    My issue was fixed by manually switching pathData to targetPath in the plugin, thank you.

  5. jderose9 commented on Dec 8, 2021

    @jderose9

    This seemed like it was working for a while for me, but lately the nomatch handler was firing inconsistently. Seems like it would stop firing after the first use. I used the instance of the object on the window rather than the angular wrapper as detailed here:

    #148 (comment)

  6. kaililleby commented on Feb 25, 2022

    @kaililleby

    This seems to be fixed in f5f024e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions