react-native-watch-connectivity
react-native-watch-connectivity copied to clipboard
Unimplemented delegate callback didReceiveFile
- (void)session:(WCSession *)session didReceiveFile:(WCSessionFile *)file { // TODO }
Is there a plan to implement this function? It is useful in cases where the size of the data transmitted from watch to phone is too large for sendMessage or userInfo.
@mdescalzo do you know what the max file size is when sending data over user-info from the watch to the phone?
I've seen 55k stated on stackoverflow. Our testing shows it isn't quite that straightforward. Compression appears to be applied to the object in transmission so it a function of the compressibility as well as size. When we built objects by repeatedly duplicating content, we could get some large objects over...200k-300k if memory serves. However, when we build test objects with randomized content we ran into errors in the 60k-70k range.
@mdescalzo yes we are seeing something similar, on Apple Watch Series 3 we are seeing the error Payload too large
but on series 4 it's ok.
Our plan is to save the large chunk of data to a JSON file on the apple watch, then compress it and send it back to the app using file transfer. Have you done something similar?
We'd planned on something like that, but the above put a damper on that. Instead we stringified the JSON blob, broke it into pieces, sent them over transferUserInfo and reassembled them on the other side. Getting the kinks worked out was a pain, but its working so far. I think sendFile would have been a better course.
@mdescalzo I have just created a PR that will enable you to receive a file from the watch - https://github.com/mtford90/react-native-watch-connectivity/pull/105
Excellent news! I'm on another task at the moment. I'll circle back to the transmission problem when I'm done.