How Big Can the Payload Be When Sending Data via Watchconnectivity

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

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).

What is maximum size of dictionary can I send through watchconnectivity

The payload size is dependent on how you send the content from the phone to the watch. You may want to consider breaking your dictionary into smaller chunks, (smaller than 65KB), or write the dictionary to a file you can then send using WCSession's transferFile:metadata method.

For more info, see this question and answer, and take a look at the docs for WCSession. The file size limits aren't documented, and may change in the future.

How to transfer large size video data from iPhone app to watch app

Solved my issue with out splitting NSData into multiple parts.Just did another solution.by downloading video in iOS side and saved into documents. then transferred file to watch app using

[_session transferFile:filePathUrl metadata:metadata];"

In watch app side. using this delegate got file and placed data in shared documents. then get file path and played video.
- (void)session:(WCSession *)session didReceiveFile:(WCSessionFile *)file



Related Topics



Leave a reply



Submit