I am using Facebook SDK and Twitter SDK for login and signup.
But they both are not opening URL from one common method. I have written code like that below for Facebook:
func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool
{
if(url.scheme == "fb1651015905222312")
{
return FBSDKApplicationDelegate.sharedInstance().application(application, openURL: url, sourceApplication: sourceApplication, annotation: annotation)
}
return true
}
This works fine and, for Twitter I have to comment the above method and have to write it like:
func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool {
if Twitter.sharedInstance().application(app, openURL:url, options: options) {
return true
}
return true
}
This works fine for Twitter only.
The issue is that I need to write one common method to open their URL in appDelegate
. So how do I overcome it?
NOTE : We can't write both method in app delegate.