Closed anyamiletic closed 2 years ago
We realised that by specifying a Custom Intent URI Page, the callbacks will fire as expected. So there was no change in the front-end code, only that every notification sent had to have the custom URI. Apparently this is a known issue, but i will still leave this issue open seeing as this is still buggy behaviour.
Hi @anyamiletic ,
We have tested the notification listeners with demo application. According to our recent tests, there are no buggy behaviour with version: 6.3.0.302.
We recommend you to try the latest updated version of React Native Push Kit. You should be careful with that, the onNotificationOpenedApp listener is called from index.js when application at killed state. Otherwise the getInitialNotification method is not a listener. You can try to call this metod manually after notification received to get received notification informations.
AppRegistry.registerComponent(appName, () => App);
HmsPushEvent.onNotificationOpenedApp((result) => {
console.log("onNotificationOpenedApp", result);
ToastAndroid.show(JSON.stringify(result, "\n", 4), ToastAndroid.SHORT);
});
If the issue persist, contact us here. Thank you for your interest.
Description We have successfully integrated HMS Core into our app, and enabled the Push Kit. We are able to use
HmsPushInstanceId.getToken
to fetch the device token, and through AppGallery Connect, send a notification to the device. However, upon clicking the notification from the NC, we are not able to read the notification parameters (none of our callbacks are getting triggered). These are the listeners we have set up:Expected behavior We expect that one of these listeners will fire when the notification is clicked on
Current behavior The app opens, but nothing is written out in the console
Logs on app reload the
HmsPushMessaging.getInitialNotification
fires:Environment
Other We couldn't find an example in the docs about handling just notifications (not data notifications, or topics) so we are not sure if these are the right handlers to use. When the app is in the foreground, background or killed, it is always the same case - no logs in the console, the listeners are not getting triggered. We have added the following in our
AndroidManifest.xml
: