Post

Replies

Boosts

Views

Activity

Reply to File transfer issue from iPhone to Watch after iOS 17.5 & WatchOS 10.5 update
Martijn: with regards to your questions: Error: Yes, the -[WCFileStorage persistOutgoingFileTransfer:] exception message continues to show in the debug console - I think this will continue to be the case until Apple fixes the bug. But I don't think you need to worry about that - there seems to be no ill effects. Compatibility: Yes, I completely replaced the func session( session: WCSession, didFinish fileTransfer: WCSessionFileTransfer, error: Error?)_ method - just commented it out altogether. But my app runs on only watchOS 9 and newer and I'm not worried about older devices than Series 6 watches. One more thing: On occasion a file with size zero can be created by my Watch app - this proved to be an issue because the Progress observer appears to not be happy with zero size files - I suppose it's not a case it was designed to handle because it never signals that the copy is complete. The result was that zero size files would accumulate on the Watch and never be deleted. But as it's an obscure edge case I just added a check for file size and made sure zero size files were deleted instead of the transfer being attempted. Wtih regards to your Simulator issues - I can't comment - perhaps because I'm working with newer Watches I've never had to resort to using the Simulator, except for testing layouts - I've always been able to get the debugger to work with the actual Watch.
Topic: App & System Services SubTopic: General Tags:
Sep ’24
Reply to File transfer issue from iPhone to Watch after iOS 17.5 & WatchOS 10.5 update
I have tried out the workaround suggested by Ziqiao Chen - using the Progress property of WCSessionFileTransfer.progress - so far in testing this has worked very well as a substitute for the session(_:didFinish:error:) callback. Seems to me that an advantage of this approach is that it happens all on the Watch side, and you don't have to rely on receiving a message from the companion app. I followed the usage pattern exemplified in the sample project "Implementing Two-Way Communication Using Watch Connectivity" - see the FileTransferObservers class. Thanks again, Ziqiao!
Topic: App & System Services SubTopic: General Tags:
Jul ’24
Reply to File transfer issue from iPhone to Watch after iOS 17.5 & WatchOS 10.5 update
Adding my voice to the chorus here - my Watch app is showing the same symptoms of this bug, e.g. the same stack trace featuring the message "Caught exception during archival: This object may only be encoded by an NSXPCCoder". I know my users are experiencing the issue because in my analytics reports I am seeing on the order of hundreds per day per user of incomplete file transfers from the Watch to the companion iOS app. Doubtless this is because the "func session(_ session: WCSession, didFinish fileTransfer: WCSessionFileTransfer, error: Error?)" WCSessionDelegate delegate method does not get called by the system, and so the Watch app can't know that the file was transferred successfully, and doesn't delete it. I have filed with Feedback - FB14064179. Hoping for some guidance from Apple on this - can/will it be fixed in the next watchOS/iOS update - or do I have to provide a workaround of the type discussed by others in this thread?
Topic: App & System Services SubTopic: General Tags:
Jul ’24
Reply to File transfer issue from iPhone to Watch after iOS 17.5 & WatchOS 10.5 update
Martijn: with regards to your questions: Error: Yes, the -[WCFileStorage persistOutgoingFileTransfer:] exception message continues to show in the debug console - I think this will continue to be the case until Apple fixes the bug. But I don't think you need to worry about that - there seems to be no ill effects. Compatibility: Yes, I completely replaced the func session( session: WCSession, didFinish fileTransfer: WCSessionFileTransfer, error: Error?)_ method - just commented it out altogether. But my app runs on only watchOS 9 and newer and I'm not worried about older devices than Series 6 watches. One more thing: On occasion a file with size zero can be created by my Watch app - this proved to be an issue because the Progress observer appears to not be happy with zero size files - I suppose it's not a case it was designed to handle because it never signals that the copy is complete. The result was that zero size files would accumulate on the Watch and never be deleted. But as it's an obscure edge case I just added a check for file size and made sure zero size files were deleted instead of the transfer being attempted. Wtih regards to your Simulator issues - I can't comment - perhaps because I'm working with newer Watches I've never had to resort to using the Simulator, except for testing layouts - I've always been able to get the debugger to work with the actual Watch.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’24
Reply to File transfer issue from iPhone to Watch after iOS 17.5 & WatchOS 10.5 update
I have tried out the workaround suggested by Ziqiao Chen - using the Progress property of WCSessionFileTransfer.progress - so far in testing this has worked very well as a substitute for the session(_:didFinish:error:) callback. Seems to me that an advantage of this approach is that it happens all on the Watch side, and you don't have to rely on receiving a message from the companion app. I followed the usage pattern exemplified in the sample project "Implementing Two-Way Communication Using Watch Connectivity" - see the FileTransferObservers class. Thanks again, Ziqiao!
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jul ’24
Reply to File transfer issue from iPhone to Watch after iOS 17.5 & WatchOS 10.5 update
Adding my voice to the chorus here - my Watch app is showing the same symptoms of this bug, e.g. the same stack trace featuring the message "Caught exception during archival: This object may only be encoded by an NSXPCCoder". I know my users are experiencing the issue because in my analytics reports I am seeing on the order of hundreds per day per user of incomplete file transfers from the Watch to the companion iOS app. Doubtless this is because the "func session(_ session: WCSession, didFinish fileTransfer: WCSessionFileTransfer, error: Error?)" WCSessionDelegate delegate method does not get called by the system, and so the Watch app can't know that the file was transferred successfully, and doesn't delete it. I have filed with Feedback - FB14064179. Hoping for some guidance from Apple on this - can/will it be fixed in the next watchOS/iOS update - or do I have to provide a workaround of the type discussed by others in this thread?
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jul ’24