Skip to content
This repository was archived by the owner on Aug 17, 2023. It is now read-only.

too many data lines in AndroidManifest / prefix ignored #165

Open
heidji opened this issue Oct 23, 2018 · 3 comments
Open

too many data lines in AndroidManifest / prefix ignored #165

heidji opened this issue Oct 23, 2018 · 3 comments

Comments

@heidji
Copy link

heidji commented Oct 23, 2018

it seems that it doesn't matter what i do, the intent-filter always gets 5 lines, the first being the one configured during the setup (doesn't seem to be editable 💃) and 4 others with empty host and scheme but with a "/" as prefix.

this renders the prefix part globally unusable because having one data line within the same intent with prefix "/" overwrites all other prefix settings. it BLEEDS into the other data lines, which means the universal link always gets triggered regardless of the prefix configured, just because there are other data lines with a lower level "/" set in them..

@heidji
Copy link
Author

heidji commented Nov 12, 2018

tip for anyone who happens to have the same problem with prefixes not being recognized because of this bug, remove the plugin and add it again with a --variable=DEEPLINK_HOST=pluginbust.com and add your own intents into the AndroidManifest.xml manually,
i know the ionic team meant good with these data lines, problem is that android doesn't differentiate the prefixes between the lines and just overwrites all prefixes with one of these default "/" you guys added..

update:
in order not to be forced to update the AndroidManifest manually, you can use this in the config.xml:

<platform name="android">
        ....
        <config-file parent="./application/activity" target="AndroidManifest.xml">
            <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="example.de" android:pathPrefix="/path/to/prefix" android:scheme="https" />
            </intent-filter>
        </config-file>
</platform>

good luck

@ebhsgit
Copy link

ebhsgit commented Sep 14, 2019

Thanks heidji.

In additional, you will need to ensure you have the following namespace in your config.xml
xmlns:android="http://schemas.android.com/apk/res/android"

@heidji heidji changed the title too many data lines in AndroidManifest too many data lines in AndroidManifest / prefix ignored Sep 16, 2019
@rubenmiq
Copy link

rubenmiq commented Aug 5, 2021

tip for anyone who happens to have the same problem with prefixes not being recognized because of this bug, remove the plugin and add it again with a --variable=DEEPLINK_HOST=pluginbust.com and add your own intents into the AndroidManifest.xml manually,
i know the ionic team meant good with these data lines, problem is that android doesn't differentiate the prefixes between the lines and just overwrites all prefixes with one of these default "/" you guys added..

update:
in order not to be forced to update the AndroidManifest manually, you can use this in the config.xml:

<platform name="android">
        ....
        <config-file parent="./application/activity" target="AndroidManifest.xml">
            <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="example.de" android:pathPrefix="/path/to/prefix" android:scheme="https" />
            </intent-filter>
        </config-file>
</platform>

good luck

When removing the plugin some remains of the prefixes were still on the android.json file. Search for ion-deeplinks and make sure to remove them before adding the plugin and the intents in the config.xml

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

No branches or pull requests

3 participants