Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does PushNotificationIOS work on the Simulator?

I am trying to show a notification on my react-native app using react-native-push-notifications which is based on PushNotificationsIOS that ships with React Native. The problem is that nothing happens, no error, no notification, nothing.

I am not sure whether I made an error when programming the notification, or it just doesn't work on a simulator.

Thank you!

like image 697
Luis Rizo Avatar asked Oct 30 '25 01:10

Luis Rizo


1 Answers

I've figured it out.

To send local notifications, we can use the simulator. When using react-native-push-notifications, I forgot to add the configurations of the push notifications to the same component that was attempting to schedule the notifications and that is the reason why it did not work.

However, to send remote notifications we need to get the device ID, but the simulator doesn't have one because it is not a real device, for that reason we cannot receive remote notifications from a server and display them using an emulator.

like image 98
Luis Rizo Avatar answered Oct 31 '25 21:10

Luis Rizo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!