I'm attempting to automate the testing of my push notifications using XCTest and Continuous Integration with Xcode Server.
我正在尝试使用XCTest和Xcode服务器的持续集成来自动测试我的推送通知。
As far as I can tell, I have correctly configured my push notifications, as I receive them correctly when the app is running. The issue is, when I run a test (even on a physical device) I don't receive the notification. I have confirmed on both the sending device as well as the backend that the push notification has been sent. As far as I know, you cannot receive push notifications on iOS simulators, but I am running the test on an actual device, so I was assuming this would be different.
据我所知,我已经正确地配置了推送通知,当应用程序运行时,我可以正确地接收它们。问题是,当我运行测试(甚至在物理设备上)时,我不会收到通知。我已经在发送设备和后端确认推送通知已经发送。据我所知,您无法在iOS模拟器上接收推送通知,但我正在一个实际的设备上运行测试,所以我假设这是不同的。
Obviously I can check manually to see if the information is consistent through the sending device, backend and receiving device, but I was hoping to automate this entire process.
显然,我可以通过发送设备、后端和接收设备手动检查信息是否一致,但我希望自动化整个过程。
Thanks for the help.
谢谢你的帮助。
1 个解决方案
#1
0
While there is no way to deal with PNs on Simulator with Apple-provided instruments, there is magic 3-rd party toolset to help on it:
虽然没有办法用苹果提供的设备在模拟器上处理PNs,但是有神奇的第三方工具可以帮助它:
https://github.com/acoomans/SimulatorRemoteNotifications
https://github.com/acoomans/SimulatorRemoteNotifications
SimulatorRemoteNotifications is a library to send mock remote notifications to the iOS simulator.
simulatorremotenoti是一个将模拟远程通知发送到iOS模拟器的库。
The library extends UIApplication by embedding a mini server that listen for UDP packets containing JSON-formated payload, and a service to send notifications to the mini server.
该库通过嵌入一个微型服务器来扩展UIApplication,该服务器侦听包含json格式的有效负载的UDP数据包,以及向迷你服务器发送通知的服务。
This project includes the iOS Simulator Notifications MacOSX app to help you send the mock notifications.
这个项目包括iOS模拟器通知MacOSX应用程序,帮助您发送模拟通知。
#1
0
While there is no way to deal with PNs on Simulator with Apple-provided instruments, there is magic 3-rd party toolset to help on it:
虽然没有办法用苹果提供的设备在模拟器上处理PNs,但是有神奇的第三方工具可以帮助它:
https://github.com/acoomans/SimulatorRemoteNotifications
https://github.com/acoomans/SimulatorRemoteNotifications
SimulatorRemoteNotifications is a library to send mock remote notifications to the iOS simulator.
simulatorremotenoti是一个将模拟远程通知发送到iOS模拟器的库。
The library extends UIApplication by embedding a mini server that listen for UDP packets containing JSON-formated payload, and a service to send notifications to the mini server.
该库通过嵌入一个微型服务器来扩展UIApplication,该服务器侦听包含json格式的有效负载的UDP数据包,以及向迷你服务器发送通知的服务。
This project includes the iOS Simulator Notifications MacOSX app to help you send the mock notifications.
这个项目包括iOS模拟器通知MacOSX应用程序,帮助您发送模拟通知。