You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before the user send his message or attachements to a mail provider, the app should check if there is any mail provider available. If the mail provider is not available, we don't need to trigger the method 'send' because it will not executed successfully:
i have implemented a solution for android and iOS which is similiar to actual plugin code:
android function:
privatefunhasProvider(callback:Result){
if (activity ==null) {
callback.success(false)
return
}
val intent =Intent()
intent.action =Intent.ACTION_SENDTO
intent.data =Uri.parse("mailto:")
val packageManager = activity?.packageManager
if (packageManager?.resolveActivity(intent, 0) !=null) {
callback.success(true)
} else {
callback.success(false)
}
}
iOS function:
privatefunc hasProvider(result:@escapingFlutterResult){
guard let viewController =UIApplication.shared.keyWindow?.rootViewController else{result(false)return}
if MFMailComposeViewController.canSendMail(){result(true)}else{result(false)}}
The text was updated successfully, but these errors were encountered:
Before the user send his message or attachements to a mail provider, the app should check if there is any mail provider available. If the mail provider is not available, we don't need to trigger the method 'send' because it will not executed successfully:
i have implemented a solution for android and iOS which is similiar to actual plugin code:
android function:
iOS function:
The text was updated successfully, but these errors were encountered: