Reputation: 1832
I have an IOS (iphone) application where the requirement is to add the total count of email sent to a certain individual in the application itself.
I have an application to show a list of users, when clicking on the user it will show the user details (phone, email address, fax etc..)
When you click on the phone number, the dialer will show with the phone number prepopulated.
When you click on the email address, the native email client will be launched with the to: address prepopulated.
Current code is like so
NSString *num = [NSString stringWithFormat:@"mailto:%@", email];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:num]];
Are there any apis or things I can call in IOS to detect whether the email has been sent? As I need to keep a count of it.
I was thinking that I will just add the count on click of the email address and am wondering if there is a better way. Am really new to iOS Development, like my first day working on it today on some legacy app.
Any help would be much appreciated. Just point me in the right direction.
Upvotes: 0
Views: 528
Reputation: 28730
if you want to read count of emails sent to a particular person then you must use web api and custom mail composer UI for this. Using MFMailComposer will not help you. For mail composer UI you can use open source projects like ThatInbox
Upvotes: 0
Reputation: 448
Check out this answer: https://stackoverflow.com/a/9013412/1550961
The key idea is that you can use the MFMailComposeViewController instead of routing the user to the system mail app. Not sure if that is an acceptable solution for you or not, using this method gives you access to a result, which will let you know if the user actually sent the mail or not.
Upvotes: 2
Reputation: 11555
Instead of invoking the standard email app, consider using MFMailComposeViewController. It will use the standard email form directly from your app and provides status information. You can then count the emails based on MFMailComposeResultSent status.
Upvotes: 1