I know how to transfer data between iPhone app and watch app. Transferring data using watch connectivity framework. But I want to transfer large file nadata it exceeds 65kb.I am looking for how to split nsdata from small parts and transfer to watch app and assemble it again in watch app.Please any one give suggestion how can I do it.
Asked
Active
Viewed 159 times
0
-
What have you tried already? What code do you have? what is going wrong with it? We'll glady *help* you, but people here won't just do it for you. Please provide more detail otherwise your post is likely to be closed by the community. Provide as much information as possible and people will make suggestions for you – Scriptable Dec 12 '16 at 13:27
-
I have video url from server. I want to play video on watch app main screen. I am transfarring video information like this NSString *urlToDownload = @"http://files........... filename.mp4"; NSURL *url = [NSURL URLWithString:urlToDownload]; NSData *urlData = [NSData dataWithContentsOfURL:url]; NSDictionary *root = @{ @"title" : @"VideoName", @"data":urlData }; WCSession *defaultSession = [WCSession defaultSession]; [defaultSession transferUserInfo:root]; – Thippi Dec 13 '16 at 06:01
-
the above method giving error 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. http://stackoverflow.com/questions/33025915/how-big-can-the-payload-be-when-sending-data-via-watchconnectivity?rq=1 – Thippi Dec 13 '16 at 06:05
-
Have you looked at this: https://developer.apple.com/library/content/documentation/General/Conceptual/WatchKitProgrammingGuide/AudioandVideo.html – Scriptable Dec 13 '16 at 10:33
-
Solved my issue. by downloading video in iOS side and saved into documents. then transfer to watch using [_session transferFile:fileUrl metadata:metadata];" – Thippi Jan 03 '17 at 13:21
1 Answers
1
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

Thippi
- 99
- 9