I am creating an SDK(static library) which would be used by the clients in their apps.
What this SDK helps them achieve is, open a set of pages, do some activity and come back to the app with the response from the webpages. How I am doing this is, opening the URL in SFSafariWebViewController and sending a returnTo URL as part of the parameters. This returnTo URL is registered with the app using CFBundleURLSchemes. The final page redirects back to the returnTo URL with the response parameters.
As per the developers.app website I need to implement the below method in AppDelegate to handle to callback to the returnTo URL.
application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation`
But I want to handle the URL in the library code(SDK) and not in the AppDelegate of the client's app.
I neither want to create a custom AppDelegate and force the SDK's client to use it in their app nor I want him to call one of my SDK's methods inside the openURL implementation of app's AppDelegate.m
.
I appreciate the help, thanks.