0
私はGoogle、Facebook & Spotifyを使用しているアプリを作っています。だから、私は私のアプリDelegate.swiftSwift3で同じApp DelegateでGoogle、Facebook、およびSpotifyを使用する方法iOS
func application(_ application: UIApplication,
open url: URL, options: [UIApplicationOpenURLOptionsKey: Any]) -> Bool
{
//For Google & Facebook
let sourceApplication = options[UIApplicationOpenURLOptionsKey.sourceApplication] as? String
let annotation = options[UIApplicationOpenURLOptionsKey.annotation]
let googleHandler = GIDSignIn.sharedInstance().handle(
url,
sourceApplication: sourceApplication,
annotation: annotation)
let facebookHandler = FBSDKApplicationDelegate.sharedInstance().application (
application,
open: url,
sourceApplication: sourceApplication,
annotation: annotation)
return googleHandler || facebookHandler
//For Spotify
if SPTAuth.defaultInstance().canHandle(url) {
SPTAuth.defaultInstance().handleAuthCallback(withTriggeredAuthURL: url) { error, session in
// This is the callback that'll be triggered when auth is completed (or fails).
if error != nil {
print("*** Auth error: \(error)")
return
}
else {
SPTAuth.defaultInstance().session = session
}
NotificationCenter.default.post(name: NSNotification.Name.init(rawValue: "sessionUpdated"), object: self)
}
}
return false
}
問題のコードの下に使用しています:どのように私は、App委任で唯一の戻り値と組み合わせることができますか?ありがとうございました。
おかげで男を試してみてください、それが動作します! – user2786