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
What steps will reproduce the problem?
1. Run your send mail function inside a background task code block e.g.
{{{
- (void) sendMessageInBackground
{
UIApplication* application = [UIApplication sharedApplication];
bgTask = [application beginBackgroundTaskWithExpirationHandler:^{
// Clean up any unfinished task business by marking where you.
// stopped or ending the task outright.
[application endBackgroundTask:bgTask];
bgTask = UIBackgroundTaskInvalid;
}];
// Start the long-running task and return immediately.
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
[self sendMessageDirectly];
[application endBackgroundTask:bgTask];
bgTask = UIBackgroundTaskInvalid;
});
}
}}}
What is the expected output? What do you see instead?
The same function called directly will successfully send an email. When the
same function is called from inside an execution block it doesn't return
successfully. The last log output is:
2012-04-02 13:10:11.146 Test Project[1954:3203] C: Attempting to connect to
server at: smtp.gmail.com:25
What version of the product are you using? On what operating system?
I'm using Xcode 4.3.2, lion and iOS 5.1
Original issue reported on code.google.com by [email protected] on 2 Apr 2012 at 12:18
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
[email protected]
on 2 Apr 2012 at 12:18The text was updated successfully, but these errors were encountered: