AppDelegate 中对成员 'subscript' 的引用不明确

Ambiguous reference to member 'subscript' in AppDelegate

我正在将我的 Swift 代码从版本 2 迁移到版本 3。在我的 AppDelegate.swift 中,我实现了以下方法:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool {

    FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)

    // error below this line
    if let notification = launchOptions?[UIApplicationLaunchOptionsKey.remoteNotification] as? [NSObject : AnyObject] {
    } else {}
    return true
}

我收到以下错误:

Ambiguous reference to member 'subscript'

我该如何解决这个问题?

按照@Larme 的建议,我通过将方法签名更改为:

解决了这个问题
func application(_ application: UIApplication,
                          didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {

    FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)

// error below this line
    if let notification = launchOptions?[UIApplicationLaunchOptionsKey.remoteNotification] as? [NSObject : AnyObject] {
    } else {}
    return true
}