Comments (9)
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.
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.
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.
This is a deal breaker 👎 I'm also experiencing this.
from react-native-notifications.
@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.
@jbolter Ultimately doing what @nkov did worked for me. This also solved a problem with the payload coming in undefined.
from react-native-notifications.
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.
The issue has been closed for inactivity.
from react-native-notifications.
Problem is actual
from react-native-notifications.
Related Issues (20)
- Invariant Violation: new NativeEventEmitter() requires a non-null argument.
- Update Robolectric version
- Subscriptions to topics
- "$" getting copied HOT 1
- Code that setting NotificationChannel sound on Android might lead unexpected consequences HOT 1
- Application does not trigger registerNotificationOpened when it is closed, only when it is in the background.
- I can't get notifications to open my app HOT 1
- How to undo `Notifications.registerRemoteNotifications()` ? HOT 3
- Minification failure with R8: Compilation failed for ReactAppLifecycleFacade$1 in react-native-notifications
- Not receiving any notification on iOS release mode only HOT 1
- Huawei push notification in library
- dexOptions is obsolete
- Feature request: add support for iOS simulator push notifications HOT 3
- Does FCM work with this package in iOS? HOT 4
- Handle callback when notification in background / terminate app HOT 3
- When I click on the notification on my android app, entire app reloads HOT 4
- Question - is there support for the new RN architecture? HOT 1
- Suggestion - documentation update HOT 1
- Feature request: support for dynamic Live Activities on IOS
- What about the wiki for integration with react notification?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-notifications.