WatchConnectivity File Transfer is received but can’t find file on watch

I am successfully transferring a .mov file and the correct delegate is being called from the watch counterpart. Yet when I try to reference the URL of the file that was transferred, the file is can’t be found. Is there a specific file path that transferred files are saved to?

Is there another way I can download a .mov file from my iPhone device to a counterpart?

Replies

https://developer.apple.com/documentation/watchconnectivity/implementing_two-way_communication_using_watch_connectivity

In the SessionDelegator func session(_ session: WCSession, didReceive file: WCSessionFile) method the footnote says the WCSessionFile.fileURL is removed when the session method returns. So I looks like accessing the file per transfer is dependant on doing so early synchronously before return.

  • I am accessing it synchronously before the method returns.

Add a Comment

As MobileTen said, the file is removed when you return from the SessionDelegate session (_ session: WCSession, didReceive file: WCSessionFile) method.

The key is moving the file to a location where you can access it from your app before you return.

This WWDC session might help with WatchConnectivity or with a better alternative (depending on your use case): There and back again: Data transfer on Apple Watch