8月微信在APP Store又升级了,发现它竟然能绕过苹果爸爸的规定:使用VoIP推送必须CallKit。微信的通话用了VoIP推送,然后弹了个本地通知,说明还是有方案完成这个需求的。

翻墙搜了很久,发现whatsapp也可以。它的方案是在entitlement文件配置了一个`com.apple.developer.pushkit.unrestricted-voip`参数,而这个参数牛逼了,不受限制的VoIP,也就是说配置了这个参数就可以绕过苹果规定了,微信应该也是添加了这个参数。

于是,我也在工作宝的entitlement文件中加了这个参数,但是编译时通不过,提示`Provisioning profile "xxx" doesn't include the com.apple.developer.pushkit.unrestricted-voip entitlement`。原来whatsapp的这个entitlement文件不是一个标准的entitlement文件,而是苹果单独授权的,于是我也给苹果发了一封邮件,希望也能拿到这个授权,回复如下,大概意思就是你得按照苹果的标准来。

---

Re: unrestricted voip


Please include the line below in follow-up emails for this request.

Hello,

Our current guidance for implementing VoIP apps in China, is to use regular UserNotifications as suggested in the “Important” note on this page:
<https://developer.apple.com/documentation/pushkit/pkpushregistrydelegate/2875784-pushregistry>

“…If you want to initiate a VoIP call without using CallKit, register for push notifications using the UserNotifications framework instead of PushKit. For more information, see UserNotifications.”

So, your app would send a standard push, starting the actual VoIP call when the user accepts your push notification.  

I am not sure about the bad experience you had with UserNotifications, but those are as reliable as VoiP pushes.
If you send a push at priority 10, and is a visible notification, it will be delivered as quickly and reliably as VoIP pushes.

So, what you would happen is, instead of the VoIP push waking up your app, there would be a visible push delivered. And when the user interacts with the notification, this will launch your app, and you can continue with the call.

You may also find it helpful to create a notification service extension:
<https://developer.apple.com/documentation/usernotifications/unnotificationserviceextension>

You can read the full details at the link above, but in the context of a VoIP call, the service extension can be used to inform your server when the notification actually reached the device (both for metric and call handling purposes) as well as allowing you to adjust the notification content.

If your app also implements messaging, the Notification Service Extension, which will be executed for every visible push, can manipulate what notifications are currently being displayed (dismissing existing notifications), as well downloading updated contents or missed messages.

You can also use a UNNotificationContentExtension to customize the content your app is actually displaying in the notification UI:
<https://developer.apple.com/documentation/usernotificationsui/unnotificationcontentextension> so it looks different than a standard notification, if your implementation requires this.

Argun Tekant
 Developer Technical Support

On August 19, 2020 at 08:39:27 AM GMT, xxxx wrote:
Team Type: Company/Organization 

PLATFORM AND VERSION 
iOS 
I add com.apple.developer.pushkit.unrestricted-voip to the entitlements file. 

DESCRIPTION OF PROBLEM 
In China, apps are forbiden to use Callkit UI. Our app is used for make sip calls, but we had a bad experience with UserNotifications. I found that wechat(微信) app could use voip push without show CallKit UI. So, how can I apply for use voip push without show CallKit UI? 

STEPS TO REPRODUCE 
When I run the project, the Xcode shown an error "Provisioning profile "xxxx" doesn't include the com.apple.developer.pushkit.unrestricted-voip entitlement". How can I to do next? 

---

网上有人说只给那些有大量用户的客户端开后门,小公司就别想拿到授权了。从实际测试情况来看,腾讯的微信、阿里的钉钉拿到了授权,字节跳动的飞书都没拿到授权,乖乖的用了普通推送。

也有可能这个只是苹果给大厂的一个临时方案,给他们多一点时间去适配。


参考:
<https://github.com/wireapp/wire-ios/issues/4447>

<https://stackoverflow.com/questions/60815763/how-does-the-whatsapp-web-client-still-work-with-the-latest-ios-update-sdk-vers/62770908#62770908>

<https://stackoverflow.com/questions/62726152/provisioning-profile-doesnt-include-the-com-apple-developer-pushkit-unrestricte>


 

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐