Comments (3)
I found the reason. If I have both notification and data payload in message and app is in the background it only displays notification in status bar, but doesn't pass anything to getInitialNotification. Service method onMessageReceived doesn't get called. If I put all fields (sound, title, body, icon) from notification payload to data payload and send only data payload onMessageReceived works well for background and foreground and getInitialNotification returns notification. More useful info here https://developers.google.com/cloud-messaging/concept-options#target
from react-native-notifications.
Good call.
Indeed, this is the weird yet well-known behavior of the default handler. It got me confused as well when I first started integrating GCM.
from react-native-notifications.
@Elf2707 link expired. Can you please describe this in detail? Thanks!
from react-native-notifications.
Related Issues (20)
- How to set batch count for android
- App relaunch on notification click. HOT 1
- Cannot read property 'refreshToken' of null. HOT 1
- registerNotificationOpened is not called when app is in foreground. HOT 1
- Crash app when recieve Notification in IOS 14 HOT 6
- Fix API Documentation so that postLocalNotification works - Includes fix HOT 1
- [iOS] getInitialNotification returnsthe notification even when the app was opened without tapping it HOT 2
- app crashes receiving a notification during startup
- How do I even use this package?
- registerNotificationOpened isn't working as expected in iOS HOT 1
- `startObserving` method call is happening post send event call
- Android 10 and below: NullPointerException: Attempt to invoke virtual method 'int android.content.Intent.getFlags()' on a null object reference HOT 1
- 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. HOT 1
- I can't get notifications to open my app HOT 1
- How to undo `Notifications.registerRemoteNotifications()` ? HOT 3
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.