Skip to content
This repository has been archived by the owner on Oct 1, 2018. It is now read-only.

Events fired in Android only locally #149

Closed
lcaprini opened this issue Apr 24, 2018 · 2 comments
Closed

Events fired in Android only locally #149

lcaprini opened this issue Apr 24, 2018 · 2 comments

Comments

@lcaprini
Copy link

lcaprini commented Apr 24, 2018

Hi,
I've installed the plugin on my app and I'm using Google Firebase's Deeplink feature, and on iOS all works perfectly, but on Android platform I've a strange behaviour.

First of all, my config.xml plugin section is:

<universal-links>
    <host name="r123u.app.goo.gl" scheme="https">
        <path event="ul_eventcode" url="/eventcode" />
        <path event="ul_agenda" url="/agenda" />
    </host>
</universal-links>

I've installed the app on my real device using

cordova run android

and after that I've used the

adb shell am start -W -a android.intent.action.VIEW -d "https://r123u.app.goo.gl/eventcode?code=1234" it.test.myapp.

All works fine: the device launches the app and the ul_eventcode event is fired (I'm showing an alert with "Event Code 1234" to test it).

So I copied the url and I pasted it in websites field in my contact inside the Contacts app.
Now if I tap on the link, the app will be opened, but no events are fired.

Can you help me?

Thanks,
--Luca

@lcaprini
Copy link
Author

lcaprini commented Apr 24, 2018

Hi again,
I'm debugging the native plugin's code and I found the line where the plugin stops to work.

UniversalLinksPlugin.java:183

// if app was not launched by the url - ignore
if (!Intent.ACTION_VIEW.equals(action) || launchUri == null) {
    return;
}

When I open link from Contacts app the value of action is "android.intent.action.MAIN", so the condition will be verified and plugin returns nothing.

I checked the AndroidManifest.xml file but seems to be correct:

...
<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="r123u.app.goo.gl" android:scheme="https" android:path="/eventcode"/>
</intent-filter>
<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="r123u.app.goo.gl" android:scheme="https" android:path="/agenda"/>
</intent-filter>
...

How can I "set" the action to "android.intent.action.VIEW" as local tests?

Thanks,
--Luca

@nordnet-deprecation-bot
Copy link
Contributor

👋 Hi! Thank you for your interest in this repo.

😢 We are not using nordnet/cordova-universal-links-plugin anymore, and we lack the manpower and the experience needed to maintain it. We are aware of the inconveniece that this may cause you. Feel free to use it as is, or create your own fork.

🔒 This will now be closed & locked.

ℹ️ Please see #160 for more information.

@nordnet nordnet locked and limited conversation to collaborators Sep 19, 2018
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

2 participants