Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

app closed - find which notification launched app - popInitialNotification equivalent #17

Open
jawadrehman opened this issue Dec 23, 2015 · 6 comments

Comments

@jawadrehman
Copy link

I think this module is 90% complete functionality wise. its just an equivalent of popInitialNotification that seems to be missing.

What I have figured out is that we will need to probably put an extra to the intent in onCreateNotification function of GcmModule.java , and probably create a method to give the value of that.

@oney
Copy link
Owner

oney commented Dec 23, 2015

Yes, identifying which notification launched app isn't supported yet.
Besides putting an extra to the intent in onCreateNotification, we should listen intent when launch the app.
In MainActivity.java

protected void onCreate(Bundle savedInstanceState) {
    getIntent(); // check if launch from notification, and send to JS
    ...
}
@Override
protected void onNewIntent(Intent intent) {
    super.onNewIntent(intent);
    // send intent to GcmAndroid module
}

There are some works to do, I think I may not have time to do it this week.

@jawadrehman
Copy link
Author

@oney i might have sorted it out - I would like to submit this as a pull request. can you give me details on how to do this.

@jawadrehman
Copy link
Author

I have done something similar. But also changed a few lines of your code, since with your code only one notification would show up if the app is not open.

@oney
Copy link
Owner

oney commented Dec 25, 2015

Can you share codes or create a PR? It will be very useful to me.

@jawadrehman
Copy link
Author

pull request here. #19

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants