How big can the payload be when sending data via WatchConnectivity?

后端 未结 1 370
你的背包
你的背包 2020-12-08 16:56

When sending data using the WatchConnectivity framework, either from the phone to the watch or vice-versa, how big can the payload be before the framework gives me the

相关标签:
1条回答
  • 2020-12-08 17:39

    According to the private symbols WCPayloadSizeLimitApplicationContext, WCPayloadSizeLimitMessage, WCPayloadSizeLimitUserInfo, the limits (as of iOS 9.0.2) are:

    • 65,536 bytes (65.5 KB) for a message
    • 65,536 bytes (65.5 KB) for a user info
    • 262,144 bytes (262.1 KB) for an application context

    I don't know why Apple wouldn't document this, other than the fact that it can be difficult when sending dictionaries through WatchConnectivity to determine exactly how large they are. Certainly the acceptable sizes may change over time.

    I couldn't find (and haven't personally observed) any maximum size limit when sending files, though I've noticed that it seems to get unreliable when you send large files (hundreds of MBs).

    0 讨论(0)
提交回复
热议问题