-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
onNotification not running for a remote notification #2017
Comments
Hi, |
Here is my notification service class:
I call the startNotifications(); function from app.js file. I am successfully getting the I am using |
Can you share the remote notification payload, without it I can't help. |
Yep |
@Dallas62 here is the payload |
The payload doesn't seems to be a valid Firebase or APN payload. |
This is the payload sent via AWS to the device. @Dallas62 we can't yet log anything on the front end as Full version:
|
I'm having the same issue, the only difference is that I'm sending some test notifications using FBC. export const configure = () => {
PushNotification.configure({
onRegister: function ({token}) {
console.log(token);
},
onNotification: function (notification) {
console.log('NOTIFICATION:', notification);
notification.finish(PushNotificationIOS.FetchResult.NoData);
},
onAction: function (notification) {
console.log('ACTION:', notification.action);
console.log('NOTIFICATION:', notification);
},
onRegistrationError: function (err) {
console.error(err.message, err);
},
permissions: {
alert: true,
badge: true,
sound: true,
},
popInitialNotification: true,
requestPermissions: true,
});
}; and then, in import {configure} from './src/helpers/notifications';
....
configure();
....
AppRegistry.registerComponent(appName, () => App); The token is printed and but no notifications are displayed. Maybe FB is down? Thanks in advance. |
There is multiple kind of notifications, do not mix concept. Firebase Console will never trigger To trigger Firebase: There is already many closed issues about this kind of issue and a |
@Dallas62 I have added the full version of the payload as well for your reference here #2017 (comment) |
@abhideepmallick Both payload are for notification-only, they will not trigger |
Same issue in Android. Here's my case
Notification structure
Environment"react-native": "0.63.4", |
@ignaciosantise It's not the same issue. You can look into the Readme:
@Override
public void onNewIntent(Intent intent) {
...
super.onNewIntent(intent);
...
} Or search in issue history for "splashscreen". |
Thanks @Dallas62 for your help. It was an issue with the splashscreen. This comment helped me #1592 (comment) |
Also had the problem that onNotification was not fired for a remote notification on Android. The Installation section says NOTE: For Android, you will still have to manually update the AndroidManifest.xml (as below) in order to use Scheduled Notifications. We were only using remote notification, not scheduled ones, but adding the extra lines to AndroidManifest.xml did the trick for us. Spent lots of time on this issue, but finally started to try the various manual installations options which was how i found this out. |
@compelling which lines did you add to make remote notifications for Android work? We are experiencing the same issue with external service notifications |
@schlafnie In your android/app/src/main/AndroidManifest.xml make sure this exists:
|
If are using splash screen then in android you may get the issue of onNotification not getting called: Solution: AndroidManifest.xml
MainActivity.java
SplashActivity.java
|
Question
Hey I am trying to get the onNotification to run from a remote notification. However I am not being able to get the onNotification to run. Could you suggest me? I have checked the example but it only contains the localNotification codes right? Can you please guide me to a remote notification example?
React native version : 0.61.3
"react-native-push-notification": "^3.5.2",
Here are my codes.
index.js
MainApplication.java
AndroidManifest.xml
build.gradle
The text was updated successfully, but these errors were encountered: