Follow-up on my previous comment (1)
I have added an available(iOS 17.0) condition to the progress observer. In order to validate whether the existing implementation with session:didFinishFileTransfer:error: still works for older iOS versions, I created a new Simulator pair in Xcode 15.4:
iPhone 11 with iOS 15.5
Watch Series 4 with watchOS 9.4
Although the Debug Console shows all expected NSLog() from the iPhone part, where file transfer works flawlessly via session:didFinishFileTransfer:error:, the files are never received on the Watch Simulator. Method session:didReceiveFile: of WCSessionDelegate is never called, despite the fact that the iOS part successfully called session:didFinishFileTransfer:error:. ❌
Even after removing the whole fix with the progress observer for iOS 17.5/watchOS 10.5, method session:didReceiveFile: of WCSessionDelegate is never called on the Watch Simulator. ❌
On a real Watch Series 6 with watchOS 10.6.1, method session:didReceiveFile: is called successfully. ✅
I'm extremely puzzled now. I hope this is an Xcode Simulator issue.
Next step: get an old iPhone 7 (iOS 15.8.3) and Watch Series 1 up-and-running, to validate on device...
@Apple, please clarify what's going on. And explain why your developers have to continually experience deteriorating quality of your tools and software.
(1) Seriously Apple, why is it not possible to edit an existing post within an hour?
Post
Replies
Boosts
Views
Activity
Thank you all for posting your successful experience with the progress observer. After implementing this, I still have several questions.
I would appreciate it, when others, such as @rolf.fox@4iiii.com or Ziqiao from Apple DTS Engineer, can comment.
Still Error
With my progress observer for fractionCompleted I can track completion. But I still see the -[WCFileStorage persistOutgoingFileTransfer:] error serializing file transfer error in the Debug Console.
Do you have the same?
Compatibility
Did you completely replace session:didFinishFileTransfer:error: by the progress observer, or did you only implement the progress observer for iOS 17.5 and above?
I ask this because the docu of WCSessionFileTransfer's property progress is set to have a minimum of iOS 12.0 and watchOS 5.0.
My app supports a minimum of iOS 12.0 and watchOS 4.0.
I only use WCSessionFileTransfer from iOS to send files to the Watch, so it seems that progress is then available in iOS. But this is an assumption, and I don't know whether a connected Watch with watchOS 4.0 will provide the progress back to iOS.
I can't verify it, because latest Xcode cannot run Simulators lower than iOS 15.0 and watchOS 8.0.
The docu also mentions that rawData is of data type Data (or NSData in Obj-C).
This means that you can easily convert it to a string with init(data:encoding:) see docu.
RFC 2822 uses UTF-8, so you can use NSUTF8StringEncoding for encoding.
You're tagging your question with Mail Extensions.
Note that this tag is related to the macOS MailKit framework.
Your question does not apply to this.
Please consider to remove this tag.
And in order to receive a useful response from the community, it's recommended to detail your question. The color codes you refer to, what are they? Did you set them, or did you measure them? And how, where in your code or storyboard? etc.
You're tagging your question with Mail Extensions.
Note that this tag is related to the macOS MailKit framework.
Your question does not apply to this, but to the iOS MFMailComposeViewController framework.
Please consider to remove this tag.
You're tagging your question with Mail Extensions.
Note that this tag is related to the MailKit framework. Your question does not apply to this. Please consider to remove this tag.
You're tagging your question with Mail Extensions.
Note that this tag is related to the MailKit framework,.
Your question does not apply to this.
Please consider to remove this tag.
How about pressing the Cancel button?
Regarding your question: please have a look into URL Encoding to escape special characters.
You're tagging your question with Mail Extensions and wwdc21-10168.
Note that both are related to the MailKit framework, which applies to macOS only.
Your question is about iOS, so please remove the inappropriate tags.
Please check the updated docu, since the constructor has been changed with 1 or 2 additional arguments:
initWithData:securityInformation:context: https://developer.apple.com/documentation/mailkit/medecodedmessage/3882877-initwithdata
initWithData:securityInformation:context:banner: https://developer.apple.com/documentation/mailkit/medecodedmessage/3882878-initwithdata
Please see my answer on another post, which might be helpful: https://developer.apple.com/forums/thread/688960?answerId=688032022#688032022
The completion of allowMessageSendForSession() has changed recently. Pass an Error in the completion, see updated Apple docu at https://developer.apple.com/documentation/mailkit/mecomposesessionhandler/3824908-allowmessagesendforsession
The docu contains a code snippet:
enum ComposeSessionError: LocalizedError {
case invalidRecipientDomain
var errorDescription: String? {
switch self {
case .invalidRecipientDomain:
return "example.com is not a valid recipient domain"
}
}
}
func allowMessageSendForSession(_ session: MEComposeSession, completion: @escaping (Error?) -> Void) {
// Confirm none of the recipients use @example.com.
if session.mailMessage.allRecipientAddresses.contains(where: { $0.hasSuffix("@example.com")}) {
completion(ComposeSessionError.invalidRecipientDomain)
} else {
completion(nil)
}
}
Finally good news; the No Feedback Assistant gave an update that the issue should be resolved in iOS 14.6 beta 1.
We just tested it an all 3 issues are resolved. Meaning that now:
After a re-install of the app, the system popup for Local Network permission is always shown.
After a re-install of the app, the iOS Settings app will always show the app name with toggle in "Settings - Privacy - Local Network" and "Settings - app name"
It's possible to consistently reshow the Local Network permission - https://developer.apple.com/forums/thread/663839 in the app without uninstalling it first, by going to Settings App - General - Reset - Reset Location & Privacy
Thank you Apple for resolving this. Hopefully next time you will act immediately after receiving valuable feedback; we did provide it 7 months ago, both on this forum as in the No Feedback Assistant.
When filtering the Apple Developer forum for the WWDC tag regarding Local Network permission via https://developer.apple.com/forums/tags/wwdc20-10110 , this is the #1 active post.
It's still not resolved, 6 months after the public launch of iOS 14.
As well as my detailed report in Apple Feedback Assistant from October 6, 2020, which refers to his forum post.
2 weeks ago I finally received a response from Apple with, quote "We haven’t had this similar complaint from other developers".
3,8k views and 20 reactions with similar complaints on this forum post...
Common Apple, you can do better. Start taking your devs seriously, who have to deal with customer complaints on a daily basis.