Xcode 8 ios 10 Simulator, you can send a push notification to the simulator

In my Firebase app. I am trying to send a push notification for an application running in a simulator. When I launch the application in iOS 10 Simulator, it successfully generates an identifier token, but shows that

notifications are not supported in the simulator.

I read somewhere about stackoverflow that you can send a push notification to the iOS 10 simulator. It's true?

+6
source share
2 answers

You cannot receive push notifications inside the simulator. You can, however, simulate receiving a push notification by creating a button or something else that calls the application (_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any]) using the notification dictionary. This is useful for testing that the rest of your logic works before you deploy the device to verify that the final click format is what you expect from it.

+4
source

Two things:

  • You cannot check the push alert in the simulator . Therefore, you should only test on the iPhone device. Additional information: If you want to check the local push notification on your device, try using Test push notification

  • You said you heard that "you can send a push notification to the iOS 10 sim." It is not true. . In iOS 10, you can view the local notification, even if the application is in the foreground. using the following delegate method "willPresentNotification", supported by iOS 10. What can you check in the simulator.

+1
source

Source: https://habr.com/ru/post/1012186/


All Articles