I have an iOS app that sends data to a watch running watchOS 4 beta 8. The iPhone is running iOS 11 beta 8.
The file is send like this:
- (void)sendFileToWatch:(NSString *)filePath withType:(NSString *)type andMetaData:(NSDictionary *)extraMetaData {
if (filePath && type && [self sessionIsReadyForCommunication]) {
NSURL *fileUrl = [NSURL fileURLWithPath:filePath];
NSMutableDictionary *metaData = [@{FileMetaDataNameKey: fileUrl.lastPathComponent,
FileMetaDataTypeKey: type} mutableCopy];
if (extraMetaData) {
[metaData addEntriesFromDictionary:extraMetaData];
}
[self.watchConnectivitySession transferFile:fileUrl metadata:metaData];
}
}
The delegate method is called
- (void)session:(WCSession *)session didFinishFileTransfer:(WCSessionFileTransfer *)fileTransfer error:(NSError *)error {
NSString *fileName = fileTransfer.file.fileURL.lastPathComponent;
[self.analyticsManager logWatchFileSent:fileName error:error];
}
with the error being:
Error Domain=WCErrorDomain Code=7013 "WatchConnectivity session cannot access the file."
UserInfo={NSLocalizedRecoverySuggestion=Verify the file path is accessible.,
NSLocalizedDescription=WatchConnectivity session cannot access the file.,
NSLocalizedFailureReason=Invalid file path, or insufficient permissions to access the file.
}
this does not happen in the non-beta versions. The error is nil there. I have filed a bug report and it was closed as dublicate to an open bug.
My question: Did you experinced something similar and found a workaround? Thanks