WhatsApp 网络客户端如何仍然使用最新的 iOS 更新(SDK 版本 13.0+)?

How does the WhatsApp web client still work with the latest iOS update (SDK version 13.0+)?

WhatsApp 客户端 2.20.31 版(2020 年 3 月发布)添加了暗模式支持。这是 iOS 13 独有的功能,从外观和感觉上看,它似乎是一个完全原生的实现。我认为可以安全地假设该应用程序现在正在使用 iOS SDK 13.0 或更高版本进行编译。

问题是,从 iOS 13 日起,Apple now requires the native call screen to be shown whenever a VoIP notification is received - 否则,该应用程序将不会收到任何进一步的 VoIP 通知。在之前的 iOS 版本中,一些应用程序(包括 WhatsApp)似乎使用 "fake" 传入的 VoIP 呼叫在用户尝试使用网络客户端时在后台静默唤醒应用程序,以便后者可以然后直接与 phone.

连接并交换数据

然而,在最新版本中,尽管 Apple 引入了限制,但 Web 客户端似乎仍像以前一样工作。使用调试器可以观察到 iOS 应用程序在用户打开 PC 上的 Web 客户端时唤醒,但从未显示任何呼叫屏幕。这可以根据需要重复进行。

The logs from WhatsApp seems to confirm what is written above:

default 17:09:44.515731+0000    callservicesd   Call source <CXXPCCallSource 0x111ecb0a0 identifier=UKFA9XBX6K.net.whatsapp.WhatsApp isConnected=1 processIdentifier=417 isPermittedToUsePublicAPI=1 isPermittedToUsePrivateAPI=0> registered with configuration <CXProviderConfiguration 0x111e9bb40 localizedName=‎WhatsApp ringtoneSoundURL=(null) iconTemplateImageData=0x0 maximumCallGroups=1 maximumCallsPerCallGroup=1 supportsAudioOnly=1 supportsVideo=1 supportsEmergency=0 supportsVoicemail=0 supportsCurrentPlatform=1 includesCallsInRecents=1 audioSessionID=1151157 supportedHandleTypes=2>

If we try to do this with our app, the results are quite different:

error   18:56:19.949023+0000    callservicesd   Killing VoIP app com.xxxxx.xxxxx.xxxxx because it failed to post an incoming call in time.

知道这里发生了什么吗? WhatsApp 是否使用任何类型的未记录的解决方法或利用某种私有 API?

这是 WhatsApp 最新的授权文件:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.developer.icloud-container-identifiers</key>
    <array>
        <string>57T9237FN3.net.whatsapp.WhatsApp</string>
    </array>
    <key>com.apple.developer.pushkit.unrestricted-voip</key>
    <true/>
    <key>com.apple.developer.ubiquity-container-identifiers</key>
    <array>
        <string>57T9237FN3.net.whatsapp.WhatsApp</string>
    </array>
    <key>application-identifier</key>
    <string>UKFA9XBX6K.net.whatsapp.WhatsApp</string>
    <key>com.apple.developer.carplay-messaging</key>
    <true/>
    <key>aps-environment</key>
    <string>production</string>
    <key>com.apple.developer.icloud-container-environment</key>
    <string>Production</string>
    <key>com.apple.developer.associated-domains</key>
    <array>
        <string>applinks:api.whatsapp.com</string>
        <string>applinks:v.whatsapp.com</string>
        <string>applinks:chat.whatsapp.com</string>
        <string>applinks:wa.me</string>
    </array>
    <key>com.apple.developer.siri</key>
    <true/>
    <key>com.apple.developer.team-identifier</key>
    <string>57T9237FN3</string>
    <key>com.apple.developer.icloud-services</key>
    <array>
        <string>CloudDocuments</string>
        <string>CloudKit</string>
    </array>
    <key>com.apple.security.application-groups</key>
    <array>
        <string>group.net.whatsapp.WhatsApp.shared</string>
        <string>group.com.facebook.family</string>
        <string>group.net.whatsapp.WhatsApp.private</string>
        <string>group.net.whatsapp.WhatsAppSMB.shared</string>
        <string>group.net.whatsapp.family</string>
    </array>
</dict>
</plist>

这个特定的权利似乎是允许他们不报告来电的原因:

com.apple.developer.pushkit.unrestricted-voip

我找不到关于此权利的任何文档,所以我很确定它们已获得 Apple 的特殊许可。

我已经就此询问了 eurodev 支持,并且刚刚收到:

目前我们没有关于您询问的无限制权利的任何其他信息。唯一可用的信息链接在这里。

https://developer.apple.com/documentation/bundleresources/entitlements

向他们反馈以获取更多信息。

谢谢。