Git Product home page Git Product logo

Comments (6)

oney avatar oney commented on July 19, 2024

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.

from react-native-gcm-android.

jawadrehman avatar jawadrehman commented on July 19, 2024

@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.

from react-native-gcm-android.

oney avatar oney commented on July 19, 2024

https://github.com/zo0r/react-native-push-notification/blob/b826276e291c0ab011eec80b210d39b63a1c2437/RNPushNotificationAndroid/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotification.java#L50
This module already handles the feature. We can use some codes and the idea to do it.

from react-native-gcm-android.

jawadrehman avatar jawadrehman commented on July 19, 2024

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.

from react-native-gcm-android.

oney avatar oney commented on July 19, 2024

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

from react-native-gcm-android.

jawadrehman avatar jawadrehman commented on July 19, 2024

pull request here. #19

from react-native-gcm-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.