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

save lastIntentString in java and get it from javascript with getLastIntent() #126

Merged
merged 3 commits into from
Nov 10, 2015

Conversation

patte
Copy link
Contributor

@patte patte commented Nov 5, 2015

hi! I added the functionality to query for the last intent string out of javascript. I did this in order to make your cool plugin work from a cold start with meteor's cordova environment (see #98). As far as I was able to understand it the problem arrives from the fact, that the android app starts from one url then meteor/cordova intercepts and calls another url in the webview. This resets javascript's world / window. I see launchmyapp waiting for handleOpenURL to be present on window but suddenly everything, including the timer is gone and handleOpenURL never get's called. What I do now is to save the last intent string in a variable in java and query with getLastIntent out of 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"
    )

Sorry, I don't have time right now to implement the functionality the other platforms right now, so I'd understand if you don't want to merge.

EddyVerbruggen added a commit that referenced this pull request Nov 10, 2015
save lastIntentString in java and get it from javascript with getLastIntent()
@EddyVerbruggen EddyVerbruggen merged commit a0eae5c into EddyVerbruggen:master Nov 10, 2015
@EddyVerbruggen
Copy link
Owner

Hey @patte this looks very useful! Any chance you can add a little piece to the readme for fellow Meteor users?

@patte
Copy link
Contributor Author

patte commented Nov 11, 2015

voilà: #127

@chriswessels
Copy link

@patte To confirm, this is currently implemented exclusively for Android?

@patte
Copy link
Contributor Author

patte commented Nov 11, 2015

yes, sorry for that ;)

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

Successfully merging this pull request may close these issues.

3 participants