AWS Mobilehub: Swift 3 update, shows error at launchoptions

那年仲夏 提交于 2019-12-25 04:57:25

问题


Since I updated my amazon web services app I created with AWS Mobilehub to swift 3 I receive the following error message:

As soon as I use "!" to remove the error my app crashes due to a fatal error:


回答1:


Sorry, but the AWS Mobile Hub console does not yet provide Swift 3 sample app code. The Swift sample app download can only be used with the legacy compiler setting in the Xcode project. We have received multiple requests for Swift 3 support, so we are working to prioritize it, but I can't provide an expected completion date at this time.

sincerely,
Andrew C
AWS Mobile Developer Experience




回答2:


launchOptions is an optional. If no shortcut is passed in, it will be nil. Check the value before passing to AWSMobileClient like so...

if let launchOptions != nil {
  return AWSMobileClient.sharedInstance.didFinishLaunching(application, withOptions: launchOptions!)
}

return false



回答3:


Modify 'func didFinishLaunching' method in AWSMobileClient.swift,

if (!isInitialized) {
    AWSIdentityManager.defaultIdentityManager().resumeSession(completionHandler: { (result, error) in
        print("Result: \(result) \n Error:\(error)")
    })
    isInitialized = true
}


来源:https://stackoverflow.com/questions/39634432/aws-mobilehub-swift-3-update-shows-error-at-launchoptions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!