PushNotification.configure doesn't work
See original GitHub issueHello,
Here is how I followed the reading is when I run the application I can not display the token because it does not fit in the PushNotification.configure present componentDidMount(). Can anybody help me? Thank you
import PushNotification from 'react-native-push-notification';
type Props ={};
export default class App extends Component<Props>{
componentDidMount(){
console.log('Did Mount');
PushNotification.configure({
onRegister:function(token) {
console.log('TOKEN: ', token);
},
onNotification:function(notification) {
console.log('NOTIFICATION: ',notification);
},
senderID: "826032976309",
popInitialNotification: true,
requestPermissions: true,
});
}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:27 (3 by maintainers)
Top Results From Across the Web
React native Push Notification onNotification event not working
PushNotification.configure({ // (required) Called when a remote or local notification is opened or received onNotification: notification ...
Read more >How to use the react-native-push-notification.configure ... - Snyk
To help you get started, we've selected a few react-native-push-notification.configure examples, based on popular ways it is used in public projects.
Read more >Troubleshooting Duo Push notification issues on iOS devices
To check if push notifications are enabled for Duo Mobile and re-enable them if needed, follow these steps: On the iPhone, open Settings....
Read more >Step by Step guide for Implementing Push Notifications in iOS ...
Implementing Push Notification was a nightmare as we had a tough time ... If you do not already have an account you can...
Read more >Notification Troubleshooting - PagerDuty Knowledge Base
You may wish to reset your push notification settings and preferences in ... Due to a Work Profile limitation from Android, overriding Do...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi!! I could solve it, placing PushNotification.configure() outside the component.
Example:
I was experiencing the same issue when sending local notifications to a simulator, the onNotificaiton is not fired. Works fine for real device.