Apple 文档显示:
PayloadTooLarge
- An error indicating that the item being sent exceeds the maximum size limit. This type of error can occur for both data dictionaries and files. Available in watchOS 2.0 and later.
有谁知道这两种方法将数据从 watch 传输到手机的最大大小限制是多少?:
func transferUserInfo(_ userInfo: [String : AnyObject]) -> WCSessionUserInfoTransfer
和
func transferFile(_ file: NSURL,
metadata metadata: [String : AnyObject]?) -> WCSessionFileTransfer
我在任何地方都找不到它的记录。谢谢!
最佳答案
关于用户信息
transferUserInfo:
甚至还有并发症信息:
transferCurrentComplicationUserInfo:
大小限制 (iOS 9) 为 65.5 kB,与您可以使用的消息相同
sendMessage:
大小限制
updateApplicationContext:
为262 kB。
关于
transferFile:
ccjensen 的答案是正确的,因为我的经验是没有实际限制,甚至 Apple 文档在 WCSession 错误代码部分中提到该文件可能太大:
WCErrorCodePayloadTooLarge An error indicating that the item being sent exceeds the maximum size limit. This type of error can occur for both data dictionaries and files.
这部分文档不太清楚,所以在使用之前必须先检查一下。
关于ios - WCSession - PayloadTooLarge,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34683648/