Closed matrixgourab closed 2 years ago
I'm having the same issue where the connecty cub notification is recieved but doesn't show up on the screen or in the notification tray, did you ever figure it out?
I'm having the same issue where the connecty cub notification is recieved but doesn't show up on the screen or in the notification tray, did you ever figure it out?
This is very common issue ,but they are not replying or not fixing these issues !
@daoma90 @joy-mollick the reason of https://github.com/ConnectyCube/connectycube-reactnative-samples/issues/222#issuecomment-878136158 is that ConnectyCUbe sends 'data' notifications and not 'notification', so this is au to developer how to process the payload
Please refer to https://developers.connectycube.com/reactnative/push-notifications?id=receive-push-notifications - here is a callback where the data should come, and then you can call local notification to display https://github.com/zo0r/react-native-push-notification#local-notifications
Closed due to inactivity. Please create a new issue if needed.
Hi,
I've added notifications into my app and by following:
Everything looks to work fine, no crashes no error logs. Unfortunately when I send a notification from the dashboard it doesn't appear on my emulator, but if I send one from firebase it works fine. Local notifications also works as expected. It triggers the onNotification function from index.js but doesn't appear (neither in status bar nor as a little top-popup)
`init() { //PushNotificationService.Navigation = navigation; const settings = { onRegister: this.subcribeToPushNotification, onNotification: this.onNotification, popInitialNotification: true, requestPermissions: true, onRegistrationError: function (err) { console.error(err.message, err); } }; if (Platform.OS !== "ios") { settings.senderID = "MY_SENDER_ID"; } else { settings.permissions = { alert: true, badge: true, sound: true, }; }
}
async subcribeToPushNotification(token) { const DeviceInfo = require("react-native-device-info").default; const params = { notification_channels: Platform.OS === "ios" ? "apns" : "gcm", device: { platform: Platform.OS, udid: DeviceInfo.getUniqueId(), }, push_token: { environment: DEV ? "development" : "production", client_identification_sequence: token.token, bundle_identifier: "com.kayanhealth.mobile" }, };
}
async onNotification(notification) { console.log("NOTIFICATION: ", notification); let dialogId = null; if (Platform.OS === "ios") { dialogId = notification.data.dialog_id; } else { dialogId = notification.dialog_id; } if ( notification.userInteraction && dialogId !== PushNotificationService.getSelectedDialog() ) { const dialog = await PushNotificationService.getDialogById(dialogId); //PushNotificationService.Navigation.push("Chat", {dialog}); } notification.finish(PushNotificationIOS.FetchResult.NoData); }`
What is the problem? Can anyone help me. Thanks in advance.