Search code examples
iosemaillaunching-applicationx-callback-url

iOS: How to Have an Application Launched with [UIApplication sharedApplication] from My App Return Control Back To My App


Right now I'm able to launch something like the mail app with this call:

NSURL* mailURL = [NSURL URLWithString: @"emailAddress@example.com?cc=&subject=Feedback"];
        [[UIApplication sharedApplication] openURL: mailURL];

However, what I'd like is for mail to return control back to my app automatically once the user finishes sending an email. Is this possible?


Solution

  • This is not possible at the moment.

    There has been a bit of an effort to try and get apps to accept a url callback parameter that would indicate which app control should be returned to.

    See http://x-callback-url.com/

    The goal of the x-callback-url specification is to provide a standardized means for iOS developers to expose and document the methods they make available to other apps. Using x-callback-url’s source apps can launch other apps passing data and context information, and also provide parameters instructing the target app to return data and control back to the source app after executing an action. Specific supported actions will be dependent on the individual apps and will not be discussed in the specification.

    but obviously without an 'official' solution you'd never get control back from mail.app.