如何在iOS XCode 11.4的模拟器中测试FCM推送通知? [英] How to test FCM push notification in simulator for iOS XCode 11.4?

查看:143
本文介绍了如何在iOS XCode 11.4的模拟器中测试FCM推送通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在模拟器中测试fcm iOS推送通知,或者可以将fcm推送通知json格式转换为apns格式以在模拟器中进行测试?

Is possible to test fcm iOS push notification in simulator or can I convert fcm push notification json format to apns format for testing in simulator?

推荐答案

是的,如果使用Xcode 11.4或更高版本,则可以在模拟器上测试推送通知.

Yes you can test push notifications on the simulator if using Xcode 11.4 or higher.

"Simulator支持模拟远程推送通知,包括 后台内容获取通知.在模拟器中,将 APNs文件到目标模拟器上.该文件必须是带有以下内容的JSON文件: 有效的Apple Push Notification Service有效负载,包括"aps" 钥匙.它还必须包含一个顶级的模拟器目标捆绑包",其中包含 与目标应用程序的分发包标识符匹配的字符串值.

"Simulator supports simulating remote push notifications, including background content fetch notifications. In Simulator, drag and drop an APNs file onto the target simulator. The file must be a JSON file with a valid Apple Push Notification Service payload, including the "aps" key. It must also contain a top-level "Simulator Target Bundle" with a string value matching the target application‘s bundle identifier.

这篇关于如何在iOS XCode 11.4的模拟器中测试FCM推送通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆