-
Notifications
You must be signed in to change notification settings - Fork 333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cordova-plugin-email-composer does not work on iOS 13+ #363
Comments
This is a showstopper for us. Has anyone found a workaround or alternative? |
Yes you can use simple html https://css-tricks.com/snippets/html/mailto-links/ |
To make ios able to communicate with other mailer apps you need to add in the info.plist the url scheme of these apps under LSApplicationQueriesSchemes, for example for iMail, gmail & outlook apps:
Now if you read the plugin's documentation there is a function that can easily check if a specified mailer app is installed and use that app. Use: And then use the specified app as a param in :
I have to warn you that I read in other issues that Apple only allows the iMail app to pass attachments and attach files (also tested it and indeed only iMail can attach files). In other use cases the other mailer apps work properly. |
@PetePrattis would you be so kind to make a PR on that? I don't have iOS so I don't have means to test it (I'm a collaborator of the project, not the initial creator), but I guess you can add these configurations in this repo's You can use xml config-file or edit-config entry. Something like <config-file target="*-Info.plist" parent="LSApplicationQueriesSchemes">
<array>
<string>mailto</string>
<string>googlegmail</string>
<string>ms-outlook</string>
</array>
</config-file> What do you think? Could you kindly test it? Also consider that the directories Thanks a lot in advance |
@Florian-crg could you kindly also test it, that is, adding this under <config-file target="*-Info.plist" parent="LSApplicationQueriesSchemes">
<array>
<string>mailto</string>
<string>googlegmail</string>
<string>ms-outlook</string>
</array>
</config-file> Don't forget to rebuild the project in that case. Thanks a lot |
I realized now that Could you kindly test this PR?
|
@Florian-crg Florian can you test it PLEASE? This is open source, let's have a collaborative working spirit. |
Sorry it was a company project, unfortunately I cannot reproduce it. You can reproduce the bug with the instruction I gave in #363 (comment). I am sorry not to be able to do more. Maybe @synapdk can help you. |
@Florian-crg I am a collaborator of the project, not the initial creator, I cannot reproduce the problem because I have no Mac nor iOS. Do you know anyone with iOS 13+ that can reproduce it? Just do it:
|
I have this problem too and unfortunately, this fix didn't help. I have tested with an iPhone 6 and iPhone 12 both on the latest version of iOS (15). The issue is with the mailto app so adding new apps presumably would only allow it to work with said new apps and does not resolve the actual issue. In my open command I added in app: 'mailto' in case the default/fallback did not work, but it didn't help. The only thing I can really add to the conversation is that after the mail app should have opened and my own app is sitting there, opening the iPhone's task manager (double press the home button on the iPhone 6, swipe up from the bottom of the screen on the iPhone 12) brings up the thumbnail of my app and the mail app then opens whilst the task manager is open. If I then return to my app, the mailto app is visible. So there's definitely something stopping the mail app showing in the foreground, but it is actually successfully opening the mail app. Obviously, having to open the task manager to get the mail app to show within your own app is a showstopper. I should point out that my app is pretty old and I am working with XCode 10.1 and opening the email composer app from within an Ionic 1 app. I'm happy to try to help further if necessary. |
@CyrixInstead Sorry anyway, but I have no iOS nor Mac, I think you have to go through the Apple Objective-C code here on this plugin considering this
#define URLEMail @"mailto:[email protected]?subject=title&body=content"
NSString * encodedString = [URLEMail stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLFragmentAllowedCharacterSet]];
UIApplication *application = [UIApplication sharedApplication];
[application openURL:[NSURL URLWithString: encodedString] options:@{} completionHandler:nil]; |
Why isn't this mentioned in the docs? |
@afulkersonApollo please read the thread, that's exactly what we were trying to avoid with the PR, but I found no one to test it. |
I had a coworker who is using Gmail on iOS 14 try this and it didn't work. Additionally, using a mailto: link doesn't seem to work either. My coworker uninstalled the default iOS app and even though Gmail is set to default, it's asking him to reinstall the default mail client. |
Do you mean this?
|
That is what I mean. The console returns:
|
@afulkersonApollo do you confirm that after the <config-file target="*-Info.plist" parent="LSApplicationQueriesSchemes">
<array>
<string>mailto</string>
<string>googlegmail</string>
<string>ms-outlook</string>
</array>
</config-file> just be sure |
That is correct. |
In that case unfortunately I can't do much, because I'm solely a maintainer of the this repo, I'm not the original creator nor I have mac or iphone, just android. You'll have to go through the code here in which case I would kindly request you to submit a PR if you find the solution for the problem. |
May I know how come iOS email alone allowing to attch the email?. The outlook with email attachement is much needed for my project. Could you please give some suggessions? |
May I ask if you were having this problem and did the recommended solution solve it? |
@jayaprasanth-g your question is offtopic, but anyway, The easiest and fastest way to do it is via base64, try for example this cordova.plugins.email.open({
subject: 'Icon',
attachments: ['base64:icon.png//iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAABaUlEQVRIid2VPU7DQBCFPxzFDeEKHCDhDoQCShQilCtERAjIJVDEGaDi5zCIhoDABGjhAKYgBTHFzOIV2rXXSZcnjTbyzL63eZ5Zw7IjBnrADZAAXxoJcK25eF7yLvAOZCXxBuxVIY6AM4vgHjgCmsCqRgs4BsZW3Uj3lsKQfwP9kk0RcKC1RqQQXYt8M+Q0irYl0vEVxeSe9z01xg4XBpp7Bequgh655z5bigRqwIPm981Dm8h0wjkw85CsaLjwA1zob6dNL6re9BCEoKUciSuZarJRQFBkEcCa5lPzIKhvK8DY92exLfCh6/oCAmbvp0vgTtftBQR2dL11JU2bjpm/TR/516Y2YuTiypDxrypwqLkJnkEDmQVzVbR9RQ5sAVPk5e6WFY8skQHy132oISef6p7TkNNElkiGjP8JMkQNjQ1gSO75TMkrtX0HubjKPjgTAmzxoY50xBXwjExoCjwBl5rzvtDlwC8o13JbRpxVtAAAAABJRU5ErkJggg==']
}); You have several online tools to convert images to base64 and you can have your onw script to convert files on the fly to base64. If you want to load files from the storage system you really have to read the file plugin docs for apache cordova. |
Sorry this recommented solution not solve it. I can open the outlook app but the attachment is not working. they said it because of http://www.faqs.org/rfcs/rfc2368.html . I don't know how to resolve it. |
@jfoclpf This is not work out. I can see the 'i' icon on iOS email but not outlook. |
I think they are referring to mailto and with mailto you cannot add attachments |
Impossible to make cordova-plugin-email-composer work on IOS 14.7.
I have GMAIL APP as a default email.
Apple Mail is deleted and I got Outlook APP which is not set as default.
Despite of having two mail Apps with on set by default it does not work.
The text was updated successfully, but these errors were encountered: