We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, I'm using react-native version( "react": "16.5.2","react-native": "^0.57.8"). Here is my configuration:
async createNotificationListeners() { const channelId = new firebase.notifications.Android.Channel("Default", "Default", firebase.notifications.Android.Importance.High); firebase.notifications().android.createChannel(channelId); this.notificationListener = firebase.notifications().onNotification((notification) => { const localNotification = new firebase.notifications.Notification({ sound: 'default', show_in_foreground: true, }); firebase.notifications().displayNotification(localNotification) .catch(err => console.error(err)); }); }
But still the notification alert can't be shown in foreground.please suggest if any mistake in my code or configuration.
The text was updated successfully, but these errors were encountered:
@ElangoPrince what was the solution?
Sorry, something went wrong.
tell us about solution please
check your AndroidManifest.xml file.
it should add these: <service android:name="io.invertase.firebase.messaging.RNFirebaseMessagingService"> <intent-filter> <action android:name="com.google.firebase.MESSAGING_EVENT" /> </intent-filter> </service> <service android:name="io.invertase.firebase.messaging.RNFirebaseInstanceIdService"> <intent-filter> <action android:name="com.google.firebase.INSTANCE_ID_EVENT"/> </intent-filter> </service> <receiver android:name="io.invertase.firebase.notifications.RNFirebaseNotificationReceiver"/> <receiver android:enabled="true" android:exported="true" android:name="io.invertase.firebase.notifications.RNFirebaseNotificationsRebootReceiver"> <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED"/> <action android:name="android.intent.action.QUICKBOOT_POWERON"/> <action android:name="com.htc.intent.action.QUICKBOOT_POWERON"/> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </receiver>
<service android:name="io.invertase.firebase.messaging.RNFirebaseMessagingService"> <intent-filter> <action android:name="com.google.firebase.MESSAGING_EVENT" /> </intent-filter> </service> <service android:name="io.invertase.firebase.messaging.RNFirebaseInstanceIdService"> <intent-filter> <action android:name="com.google.firebase.INSTANCE_ID_EVENT"/> </intent-filter> </service> <receiver android:name="io.invertase.firebase.notifications.RNFirebaseNotificationReceiver"/> <receiver android:enabled="true" android:exported="true" android:name="io.invertase.firebase.notifications.RNFirebaseNotificationsRebootReceiver"> <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED"/> <action android:name="android.intent.action.QUICKBOOT_POWERON"/> <action android:name="com.htc.intent.action.QUICKBOOT_POWERON"/> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </receiver>
and user this answer to create your channel in react native. #988
No branches or pull requests
Hi,
I'm using react-native version( "react": "16.5.2","react-native": "^0.57.8").
Here is my configuration:
But still the notification alert can't be shown in foreground.please suggest if any mistake in my code or configuration.
The text was updated successfully, but these errors were encountered: