Nev*_*aul 2 xcode apple-push-notifications ios ios-simulator
如何在不使用 ios 设备的情况下使用 Xcode 11.4 及更高版本在 IOS 模拟器中测试推送通知。
Xcode 11.4 及更高版本支持使用模拟器测试推送通知。
去测试,
Controlroom 是我最近遇到的一个了不起的应用程序,它允许控制模拟器。它提供了一个很好的 UI 来自定义通知。特别感谢 Paul Hudson 在 git 中分享源代码。Git URL - https://github.com/twostraws/ControlRoom
在终端中运行以下命令
xcrun simctl push <simulator identifier> <bundle identifier of the app> <pushcontentfile>.apns"
Run Code Online (Sandbox Code Playgroud)
Xcode Menu => Window => Devices and Simulators
Run Code Online (Sandbox Code Playgroud)
{
"aps": {
"alert": "Push Notifications Test",
"sound": "default",
"badge": 1
}
}
Run Code Online (Sandbox Code Playgroud)
.apns 文件应包含应用程序的包标识符作为有效负载的一部分
{
"Simulator Target Bundle": "<bundle identifier of the app>",
"aps": {
"alert": "Push Notifications Test",
"sound": "default",
"badge": 1
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1865 次 |
| 最近记录: |