简体   繁体   中英

Android Deep Links for debug purposes

I have an Ionic Angular application that directs the user to a browser for authentication via Auth0, and then is meant to redirect back to the application after. The only issue is, it never redirects, because deep links haven't been setup yet.

My question is, is it possible to setup deep links in a debug app that hasn't been submitted to the app store yet? How am I meant to replicate the behavior I want for testing otherwise if not possible?

You can use Ionic deep link plugin to set up the deep links in your android app. It doesn't matter whether its a debug build or a release build.

import { Deeplinks } from '@awesome-cordova-plugins/deeplinks/ngx';

   constructor(private deeplinks: Deeplinks) { }

    this.deeplinks.route({
      '/about-us': AboutPage,
      '/universal-links-test': AboutPage,
     '/products/:productId': ProductPage
    }).subscribe(match => {
       // match.$route - the route we matched, which is the matched entry from the arguments to route()
       // match.$args - the args passed in the link
      // match.$link - the full link data
 console.log('Successfully matched route', match);
  }, nomatch => {
  // nomatch.$link - the full link data
 console.error('Got a deeplink that didn\'t match', nomatch);
 });

Reference : https://ionicframework.com/docs/native/deeplinks

For capacitor follow this: https://capacitorjs.com/docs/guides/deep-links

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