2016-12-30 83 views
1

我使用谷歌登錄框架按照有關文件曖昧參考成員「下標」

func application(application: UIApplication, 
       openURL url: NSURL, options: [String: AnyObject]) -> Bool { 
    return GIDSignIn.sharedInstance().handleURL(url as URL!, 
               sourceApplication: options[UIApplicationOpenURLOptionsSourceApplicationKey] as? String, 
               annotation: options[UIApplicationOpenURLOptionsAnnotationKey]) 
} 

這是給錯誤

Ambiguous reference to member 'subscript'

請求幫助谷歌登錄構架這個。

+0

複製,如果可能的話貼全錯誤或截圖在Xcode。 –

+0

https://www.mx7.com/view2/zzYR2qvvDoTTyMY1我的屏幕截圖 –

+0

Upload images here:http://stackoverflow.com/help/formatting – jtbandes

回答

0

我覺得iOS 9.0和之前,您應該使用此方法。檢查此answer

func application(_ application: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any])-> Bool { 
     return GIDSignIn.sharedInstance().handleURL(url, 
         sourceApplication:options[UIApplicationOpenURLOptionsKey.sourceApplication] as? String, 
         annotation: [:]) 
    } 
+1

謝謝,它的工作原理! –