Notification popup not appearing in when in background or quit state.
See original GitHub issueBug
Hi, I’m having an issue while receiving notification when the app is in the background or killed in fact I can see the notification is received, can see the icon in the status bar, vibration working like normal but no popup appears.
Please find below my environment and config info, Thanks !
Environment info
react-native info
output:
System:
OS: macOS 10.15.5
CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
Memory: 81.48 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 13.10.1 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.13.7 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK: Not Found
IDEs:
Android Studio: 3.6 AI-192.7142.36.36.6392135
Xcode: 11.5/11E608c - /usr/bin/xcodebuild
Languages:
Java: 11.0.2 - /usr/bin/javac
Python: 2.7.15 - /usr/local/bin/python
npmPackages:
@react-native-community/cli: ^2.9.0 => 2.10.0
react: 16.11.0 => 16.11.0
react-native: 0.62.2 => 0.62.2
npmGlobalPackages:
*react-native*: Not Found
Library version: 3.5.2
Steps To Reproduce
- Put the app in the background or kill it
- Send the notification
Describe what you expected to happen:
- A popup appears showing the notification when the app is killed or in the background
Reproducible sample code
build.gradle
buildscript {
ext {
googlePlayServicesVersion = "20.0.0"
firebaseIidVersion = "20.2.0"
firebaseMessagingVersion = "20.2.0"
buildToolsVersion = "28.0.3"
minSdkVersion = 21
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
ext.kotlinVersion = '1.3.10'
}
repositories {
google()
jcenter()
mavenCentral()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath 'com.google.gms:google-services:4.3.3'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}
app/build.gradle
implementation 'com.google.firebase:firebase-analytics:17.4.3'
implementation 'com.google.firebase:firebase-crashlytics:17.0.0'
implementation 'com.google.firebase:firebase-messaging:20.2.0'
implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0'
Payload:
{ "notification": { "text": "test", "title": "title" }, "data": { "dataSample": "sample"}, "priority": "high" }"
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:15
Top Results From Across the Web
Receive messages in an Android app - Firebase - Google
If you want foregrounded apps to receive notification messages or data messages, you'll need to write code to handle the onMessageReceived callback. For...
Read more >Notifications Not Shown - Mobile Push
"Delivered" notifications in OneSignal means we have successfully sent the notification to the push servers (FCM/APNS/WNS etc..). These push servers then ...
Read more >Change notification and quick settings in Windows
In Windows 11, notification center is where you'll find app notifications and quick settings—which give you quick access to commonly used settings and...
Read more >Notifications Overview | Android Developers
Appearances on a device · Status bar and notification drawer · Heads-up notification · Lock screen · App icon badge · Wear OS...
Read more >Change Notifications settings on Mac - Apple Support
On your Mac, change how notifications appear in Notification Center and specify when you don't want to be disturbed by notifications.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi,
I now recommend you to create channels yourself according to the documentation, and pass the channel when triggering the notification. In the next version, this will not be allowed anymore.
Yes this is a fixed value such as
rn-push-notification-channel-id-4-300