Group Group Group Group Group Group Group Group Group

WatchConnectivity File Transfer?


Hello all:

I am writing seom data to an FMDB databse file on the watch, and then I want to sed that file to the iPhone so the user can view the data. I set up the WatchConnectivity session, and on the watch use this code to se d the file:

let filePath = NSURL.fileURL(withPath: databasePath)
self.session.transferFile(filePath, metadata: nil)

and then on the Phone I implemented:

func session(session: WCSession, didReceiveFile file: WCSessionFile)
print(“Received File with URL: (file.fileURL)”)

Just to test if the file is received. However in the debugger I am getting this error:
[WC] __45-[WCSession handleIncomingFileWithPairingID:]_block_invoke_3 delegate TestApp.ModeViewController does not implement session:didReceiveFile:, discarding incoming content

which does not make sense becuase I did implement the method. I also tried adding:

func session(session: WCSession, didReceive: WCSessionFile)

but that did not help.

Cany anyone help with this?