How to simulate a local/push notification in iOS s

2019-07-17 18:08发布

WatchKit allows us to simulate notifications with an .apns file.

How can I do the same thing in an iOS app? (Preferably in the simulator.)

The reason I ask is that I want to have the debugger active when the app is initially launched via a notification (i.e. I want to see what happens in the application:didFinishLaunchingWithOptions: method). If I start a new debugging session it will call application:didFinishLaunchingWithOptions: immediately, and then I can never test that code path when I tap on the notification.

1条回答
劫难
2楼-- · 2019-07-17 18:47

There isn't any way to simulate a notification in the simulator. You can debug to a real device and send a sandbox push notification to hit that function in Xcode.

查看更多
登录 后发表回答