Open jm90m opened 2 years ago
hi, you can try this methods..
RNPusherPushNotifications.on('notification',(notification) => { handleNotification(notification); });
const handleNotification = async (notification) => { screen.props.getNotifications(10, screen, screen.props.navigation); // iOS app specific handling if (Platform.OS === 'ios') { switch (notification.appState) { case 'inactive': // inactive: App came in foreground by clicking on notification. // Use notification.userInfo for redirecting to specific view controller case 'background': // background: App is in background and notification is received. // You can fetch required data here don't do anything with UI case 'active': // App is foreground and notification is received. Show a alert or something. default: break; } } else { // console.log("android handled notification..."); } };
Using this lib with react-native-notifications helped a lot for Android, its working fine here with background and foreground notifications.
@gabrielbezerra81 How do you integrate it with pusher?
Hello,
I've followed the setup exactly for android, not too sure what I am missing.
Project is here - https://github.com/snapshot-labs/snapshot-app
I can't seem to receive a notification on my android device. This function never gets called
handleNotification
I know people are busy, so I can offer crypto for someones time on helping me with this issue.