WCSession-PayloadTooLarge [英] WCSession - PayloadTooLarge

查看:132
本文介绍了WCSession-PayloadTooLarge的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Apple文档显示:

Apple Documentation shows:

PayloadTooLarge- 指示正在发送的商品超过最大尺寸限制的错误.数据字典和文件都可能发生这种类型的错误. 在watchOS 2.0和更高版本中可用.

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.

有人知道这两种方法将数据从手表传输到手机的最大大小限制是什么吗?:

Does anyone know what the max size limits are for both these methods are for transferring data from the watch to the phone?:

func transferUserInfo(_ userInfo: [String : AnyObject]) -> WCSessionUserInfoTransfer

func transferFile(_ file: NSURL,
         metadata metadata: [String : AnyObject]?) -> WCSessionFileTransfer

我在任何地方都找不到文档.谢谢!

I can't find it documented anywhere. Thanks!

推荐答案

关于userInfo

Regarding userInfo

transferUserInfo:

transferUserInfo:

甚至包括并发症信息:

transferCurrentComplicationUserInfo:

transferCurrentComplicationUserInfo:

大小限制(iOS 9)为 65.5 kB ,与可用于

the size limit (iOS 9) is 65.5 kB, the same for messages you can use with

sendMessage:

sendMessage:

updateApplicationContext:

updateApplicationContext:

262 kB .

关于

transferFile:

transferFile:

ccjensen的答案是正确的,因为我的经验是没有没有实际限制,即使在WCSession错误代码部分中提到的Apple文档可能文件太大:

ccjensen's answer is correct as my experience there is no actual limit even the Apple doc mentioned in the WCSession error code section that the file could be too big:

WCErrorCodePayloadTooLarge一个错误,指示该项目正在 已发送的邮件超过了最大大小限制.可能会发生以下类型的错误 数据字典和文件.

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.

文档的这部分内容还不清楚,因此您必须在使用前始终进行检查.

This part of the documentation is not really clear so you have to check it always before using it.

这篇关于WCSession-PayloadTooLarge的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆