I want to show data that was saved on the Watch App Documents folder in the Files.app on the paired iPhone.
I can save and retrieve the image within the watchOS app:
let path = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first?.appendingPathComponent(folderName).path
let data = image.pngData()
do {
try data.write(to: path)
print(path)
print("Sucess saving")
} catch let error {
print("Error saving. \(error)")
}
Both with simulator and watch7 data is saved correctly in:
file:///var/mobile/Containers/Data/PluginKitPlugin/3262F904-579E-4B60-9967-1A6931CC5F97/Documents/SensorData/image.png
I have set Supports Document Browser, Custom iOS Target Properties and Application supports iTunes file sharing, within info.plist as suggested in other posts.
I'm using XCode 14
, deployment for iOS15.4
and watchOS 8.7
.
Thanks for any help/suggestions.