Not able to sign in with AWSMobileClient iOS. Getting AWSMobileClientError error 13

两盒软妹~` 提交于 2020-01-25 08:14:06

问题


I'm using the AWSMobileClient on iOS for authentication and I'm not able to sign in. I'm calling the signin method and all I'm getting is the following error:

The operation couldn’t be completed. (AWSMobileClient.AWSMobileClientError error 13.)

This error is useless to me and I can't find any decent documentation on what this error means. Has anyone seen this? Appreciate your help.


回答1:


Please take a look at this https://github.com/aws-amplify/aws-sdk-ios/issues/1538#issuecomment-491905913

You can cast the error as AWSMobileClientError and switch on it to exhaust the list of errors.

Alternatively, I've moved over the internal message property over to my app like this:

https://github.com/lawmicha/iOS-User-Authentication-with-Email-Facebook-Google/blob/master/AmplifyUserAuthentication1/Internal/ErrorMapper.swift

extension AWSMobileClientError {
    var message: String {
    switch self {
    case .aliasExists(let message),
         .badRequest(let message),

and then I can access the message on error after casting it to AWSMobileClientError from if let error = error as? AWSMobileClientError

You should keep in mind that the alternative method exposes the message which is a developer facing message and not a end-user facing message. Ideally when you need to provide an end-user facing message, you would use first method and map the error case to a specific localized message.



来源:https://stackoverflow.com/questions/59230144/not-able-to-sign-in-with-awsmobileclient-ios-getting-awsmobileclienterror-error

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