Skip to content
This repository was archived by the owner on Mar 1, 2022. It is now read-only.

Intents looping repeatedly #125

@micahlt

Description

@micahlt

This plugin works perfectly and I thank you so much for it!

However, I'm experiencing some issues with intents occurring multiple times. My context is an unofficial mobile client for the children's programming site Scratch. I'm using this plugin to offer users the opportunity to forward links from the Scratch website directly to the app. Opening with my app works fine, but when you select "Open with Chrome", the "open with" popup appears up to four or five times before it finally opens the site. Any ideas of what could be causing this? Here's my only implementation of your plugin:

import {
  isPlatform
} from '@ionic/vue';

if (isPlatform('android')) {
      try {
        window.plugins.intentShim.onIntent(function(intent) {
          let uri = utils.matchRegexes(intent.data);
          if (uri.type == "homepage") {
            return 0;
          } else if (uri.type == "project" || uri.type == "studio") {
            window.location.replace(`/tabs/tab1?${uri.type}=${uri.id}`);
          }
        });
      } catch {
        console.error('Could not find Android Intent Shim plugin - see https://ionicframework.com/docs/native/web-intent');
      }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions