Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This plugin overrides intent-filter provided by cordova-universal-links-plugin #244

Open
slorber opened this issue Jun 6, 2017 · 3 comments

Comments

@slorber
Copy link

slorber commented Jun 6, 2017

Hi,

I need in my app both deep linking (with cordova-universal-links-plugin, not hacky redirect) and custom url scheme.

The "universal link" plugin needs to setup manifest:

      <intent-filter android:autoVerify="true">
        <action android:name="android.intent.action.VIEW"/>
        <category android:name="android.intent.category.DEFAULT"/>
        <category android:name="android.intent.category.BROWSABLE"/>
        <data android:host="stample.co" android:scheme="https" android:pathPattern="/link/.*"/>
      </intent-filter>

But just afterward, the "custom url scheme" plugin overrides that declaration with:

            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:host=" " android:pathPrefix="/" android:scheme=" " />
            </intent-filter>

I'm not an Android developer at all but this seems wrong to be. The documentation of Android mention that a data tag without at least a scheme does not make sense. Not sure what this plugin tries to achieve here: any idea?

Here's the commit from @EddyVerbruggen

It could be nice to make sure that both plugins work fine together. Thanks

@slorber
Copy link
Author

slorber commented Jun 6, 2017

Not sure it's related to the above PR/commits finally because I can reproduce the override by using v2.1.5.

Any idea on how we could avoid this override?

@slorber
Copy link
Author

slorber commented Jun 7, 2017

There's hopefully a workaround by configuring both plugin to support deep linking (note one use pathPrefix while the other use pathPattern params)

    <universal-links>
        <ios-team-id value="xxx" />
        <host name="stample.co" scheme="https">
            `<path url="/link/*" />
        </host>
    </universal-links>
    <plugin name="cordova-plugin-customurlscheme" spec="4.2.0">
        <variable name="URL_SCHEME" value="stample" />
        <variable name="ANDROID_SCHEME" value="https" />
        <variable name="ANDROID_HOST" value="stample.co" />
        <variable name="ANDROID_PATHPREFIX" value="/link" />
    </plugin>

@slorber
Copy link
Author

slorber commented Aug 29, 2017

I've found a better workaround for this issue.

It looks like config.xml declaration order matters. If I put <universal-links> after the <plugin name="cordova-plugin-customurlscheme" spec="4.2.0">, I am able to get the expected android manifest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant