nordnet / cordova-universal-links-plugin

[DEPRECATED] - Cordova plugin to support Universal/Deep Links for iOS/Android.
https://github.com/nordnet/cordova-universal-links-plugin/issues/160
MIT License
349 stars 529 forks source link

Activity not started, unable to resolve Intent #102

Closed AnielloFalcone closed 5 years ago

AnielloFalcone commented 7 years ago

HI,

I'm having some issues using this plugin on android (didn't even tried on ios) using Ionic.

The problem is that when I launch:

adb shell am start -W -a android.intent.action.VIEW -d "10.128.122.228:3000" com.ionicframework.myapp517087

this is the response:

Starting: Intent { act=android.intent.action.VIEW dat=10.128.122.228:3000 pkg=com.ionicframework.myapp517087 } Error: Activity not started, unable to resolve Intent { act=android.intent.action.VIEW dat=10.128.122.228:3000 flg=0x10000000 pkg=com.ionicframework.myapp517087 }

This is my config.xml plugin configuration:

`

`

and this is my app.js file:

// here we are subscribing for the default UL event, since it's not explicitly defined in config.xml
document.addEventListener('ul_loginEvent', didLaunchAppFromLink, false);

// this function should be is executed when we will launch the app from the link
function didLaunchAppFromLink(event) {
    var urlData = event.detail;
    alert(urlData);
    alert('Did launch!');
}

Also, if I try to inject the module universaLinks, it is not loaded and gives me dependency error (i loaded the universal_links.js file in the index.html and injected its dependecy in the app.js file.

Thanks a lot for any help

nikDemyankov commented 7 years ago
  1. Have you tried to add http? Like this:
    adb shell am start -W -a android.intent.action.VIEW -d "http://10.128.122.228:3000" com.ionicframework.myapp517087
  2. Have you tried to use not an IP? Any domain will do the trick, even if it doesn't exist, since you are testing this locally. For example:
    <universal-links>
    <host name="somedomain.com" event="ul_loginEvent" />
    </universal-links>

    And then:

    adb shell am start -W -a android.intent.action.VIEW -d "http://somedomain.com" com.ionicframework.myapp517087
  3. If universalLinks module is not found - then it's some Ionic installation error...
slorber commented 7 years ago

I had this problem, it just needed to add /.MainActivity at the end:

adb shell am start -W -a android.intent.action.VIEW -d "http://somedomain.com" com.ionicframework.myapp517087/.MainActivity

slorber commented 7 years ago

Actually this should work without the /.MainActivity at the end. If it does not it probably won't open your app on link clicks unfortunatly.

In my case it didn't work because I was also using custom-url-scheme plugin which overrides this plugin's config, leading to this plugin not working.

See https://github.com/nordnet/cordova-universal-links-plugin/issues/117

nordnet-deprecation-bot commented 5 years ago

šŸ‘‹ 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.