I have SQLite file which created by Core Data and want to transfer file from iPhone to Apple Watch. I choose WCSession
to do that. I can receive the file on the Apple Watch, but I did not find any data which I saved in the iPhone file. Is there any trick or way to solve my problem?
I used the below code for transferring the file:
let str = NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory.DocumentDirectory, NSSearchPathDomainMask.UserDomainMask, true)[0].stringByAppendingString("/SingleViewCoreData.sqlite") as String
session!.transferFile(NSURL(fileURLWithPath: str), metadata: nil)
Is there any other way for accurate synchronization of data at any time in the background? Can I use an app group in watchOS 2.0?