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

handleOpenURL not firing on cold start on Android with Meteor framework #98

Closed
Exilz opened this issue Jul 7, 2015 · 8 comments
Closed

Comments

@Exilz
Copy link

Exilz commented Jul 7, 2015

I am building an app with Meteor and Cordova 5.0, my devices are on Android 5.1 and 4.3.
I can't figure out a way to trigger the handleOpenURL function if the app wasn't launched before calling the custom scheme. The app is still launched, though.

If the app is already launched and in background, it works fine.

I'm simply using

handleOpenURL = function handleOpenURL(url) {
    var view = url.replace("totems://", "");
    Router.go(view);
};

(it defers a little from the example since it's a Meteor tweak).
It looks like it's the same issue as #93 on iOS.

@benjick
Copy link

benjick commented Jul 9, 2015

Same with the iOS simulator

@bd-arc
Copy link

bd-arc commented Jul 9, 2015

I am experiencing the same issue, which unfortunately questions the point of the entire plugin...

I've already used it before, and, back then, everything was working as expected. Does anyone have a clue about the reason for this change?

@EddyVerbruggen
Copy link
Owner

@bd-arc yeah of course that would render the plugin rather useless. Shall we focus on finding the problem? Please send me the simplest possible Cordova project where it's not working for you and I'll gladly take a look.

@bd-arc
Copy link

bd-arc commented Jul 9, 2015

@EddyVerbruggen Thank you very much for taking the time :)

Unfortunately, I deduced from your answer in issue #93 that Meteor (which I am using) might very well be part of the problem.

I will try and create a simple project without Meteor and let you know if this works as expected.

@Exilz
Copy link
Author

Exilz commented Jul 10, 2015

Ok, so I tried to reproduce the bug on a blank cordova project with : cordova 5.0.0, crosswalk and the latest version of your plugin.
The function is triggered even on a cold start, so this issue isn't about your plugin but more about how to use it properly with Meteor.
Sadly, I guess you won't help us since it's not directly related to you, but feel free to take a look at this marvellous framework. ;)

I edited the isue's title.

@Exilz Exilz changed the title handleOpenURL not firing on cold start on Android handleOpenURL not firing on cold start on Android with Meteor framework Jul 10, 2015
@bd-arc
Copy link

bd-arc commented Jul 10, 2015

@Exilz I can confirm your findings...

@EddyVerbruggen Sorry for having bothered you, as it is clearly a Meteor issue. I will keep you informed if I ever find a fix.

@patte
Copy link
Contributor

patte commented Nov 5, 2015

@bd-arc @Exilz I'm stumbling upon the same problem. any chance you two have new information to make it work with meteor?

@patte
Copy link
Contributor

patte commented Nov 5, 2015

alright, I made it work with the following workaround master...patte:master
I save the incoming intent string in lastIntent and I added a function getLastIntent, which you can call from meteor like this:

    window.plugins.launchmyapp.getLastIntent( (intent)->
      if intent.indexOf 'myawesomeapp://' > -1
        # handle intent
      else
        console.log "ignore intent: #{intent}"
    , (error) ->
      console.log "no intent received"
    )

For more info see this PR #126

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

5 participants