iOS 14 以后,使用组播广播功能 需要 申请权限 。
1、申请地点:https://developer.apple.com/contact/request/networking-multicast ;
2、填写相应的 App Information ,提交了等待考核 ;
3、等待几天,考核通过了会给你发邮件:
Your request to use Multicast Networking was approved. You can now add the Multicast Networking entitlement with your Provisioning Profile.
4、登录开发者账号,证书管理界面,在 App ID 的设置界面,增长对应权限:
Additional Capabilities 中,把 Multicast Networking 给勾上;
5、重新生成 Profiles 里对应的证书;
6、在工程里设置 .entitlements 文件,增长一项
Key:com.apple.developer.networking.multicast
type:boolean
Value:YES
7、在 Info.plist 文件中,添加当地网络使用权限:
Privacy - Local Network Usage Description
权限题目办理完毕,组播广播功能可以正常开发使用了