Giter Site home page Giter Site logo

Comments (9)

nkov avatar nkov commented on July 24, 2024 2

For me, this was because in the payload I was sending the notification in an object with key "notification". Changing it to data fixes it:

"data": { "title": "Hello", "body": "World!" }

from react-native-notifications.

jeffmwells avatar jeffmwells commented on July 24, 2024

I am also having this issue. I do not have a way to specify the payload format when sending from the firebase console, has anyone got a workaround aside from switching libraries?

from react-native-notifications.

jbolter avatar jbolter commented on July 24, 2024

Ok I'm back to this plugin because the RNPN plugin conflicts with the wix RNN library. So I am trying to solve this blank push issue. I'm actually seeing the opposite from what @nkov describes. My push payload is currently using "data" and we switched it to use "notification". Now with "notification" we can see that the push is not blank, we see the title and body.

However now we are getting double push notifications in the app for each single notification that we send. After a little research I found that this is because gcm and firebase are both being included as dependencies in my app and are causing the duplicates as referenced here... https://stackoverflow.com/questions/38167125/firebase-send-push-notification-twice

Altering my build.gradle to exlude firebase appears to have solved my issue with the double notification and sending both data and notification payloads seems to have solved the blank issue.

compile (('com.google.android.gms:play-services:9.2.1')) { exclude group: "com.google.firebase" }

from react-native-notifications.

ricardofbarros avatar ricardofbarros commented on July 24, 2024

This is a deal breaker 👎 I'm also experiencing this.

from react-native-notifications.

jbolter avatar jbolter commented on July 24, 2024

@ricardofbarros @swellingt0n We had to figure out how to fix that as well since we could not modify the payload easily of a 3rd party. I ended up forking the repo and making a minor change to GcmMessageHandlerService.java.

You can see the change here:
master...jbolter:master

Notice that I'm hard-coding the "app name" as the title of the push notification. This allows a push that is missing the "body" payload but has the "message" payload to show in the notification tray.

from react-native-notifications.

jeffmwells avatar jeffmwells commented on July 24, 2024

@jbolter Ultimately doing what @nkov did worked for me. This also solved a problem with the payload coming in undefined.

from react-native-notifications.

stale avatar stale commented on July 24, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.

from react-native-notifications.

stale avatar stale commented on July 24, 2024

The issue has been closed for inactivity.

from react-native-notifications.

anatooly avatar anatooly commented on July 24, 2024

Problem is actual

from react-native-notifications.

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.