iOS11 / watchOS4 cannot transfer images anymore (WCErrorCodeFileAccessDenied)

what worked on iOS 10/watchOS3 does not work work on iOS11/watchOS45 anymore


NSString *filePath = [self securedDocumentsPathForFileName:[key stringByAppendingFormat:@"@%ix.png",(int)[UIScreen mainScreen].scale]];
  NSURL *url = [NSURL fileURLWithPath:filePath isDirectory:NO];/
  NSDictionary *metadataDict = @{@"filename":key};/
  [self.session transferFile:url metadata:metadataDict];


this results in a WCErrorCodeFileAccessDenied


Any ideas?

Accepted Reply

Hi,

Do you use Shared AppGroup folder ?


Here, since iOS11, i can't transferFile from AppGroup


/private/var/mobile/Containers/Shared/AppGroup/xxxx-xxxx.../


WCErrorCodeFileAccessDenied



but from Application Support , it's ok


(So, a workaround is to copy the file in tmpdir and transfer it. But it's not very nice)

(PS: The problem is iOS11 because it's the same problem with iOS11b6+WatchOS3xx not beta)


If you have any information about this change, please let me know

Thanks

GB

Replies

Hi,

Do you use Shared AppGroup folder ?


Here, since iOS11, i can't transferFile from AppGroup


/private/var/mobile/Containers/Shared/AppGroup/xxxx-xxxx.../


WCErrorCodeFileAccessDenied



but from Application Support , it's ok


(So, a workaround is to copy the file in tmpdir and transfer it. But it's not very nice)

(PS: The problem is iOS11 because it's the same problem with iOS11b6+WatchOS3xx not beta)


If you have any information about this change, please let me know

Thanks

GB

I am still witnessing the same thing, file transfers do not work even in the iOS11 beta 10. I am also using App Group for saving and reading the file.


Would be nice to have this working as in iOS10, watchOS3.

Yes I too have varying results, rather discouraging even on the GMs