GithubHelp home page GithubHelp logo

Comments (3)

ameter avatar ameter commented on July 18, 2024

Thanks for reporting this. Can you provide some additional details such as your config with sensitive information removed and the code snippet you're using to initialize the AppSync client? Without the ability to reproduce this issue, this will be difficult to diagnose.

from aws-mobile-appsync-sdk-ios.

chajuss avatar chajuss commented on July 18, 2024

@ameter Thanks for your reply.

Here is our configuration code:

["UserAgent": "aws-amplify/cli",
                "Version": "0.1.0",
                "IdentityManager": ["Default": [:]],
                "AppSync": [
                    "Default": [
                        "ApiUrl": apiUrl,
                        "Region": "aws-region",
                        "AuthMode": "AMAZON_COGNITO_USER_POOLS",
                        "ClientDatabasePrefix": "Application_AMAZON_COGNITO_USER_POOLS"
                    ]
            ],
                "CredentialsProvider": [
                    "CognitoIdentity": [
                        "Default": [:]
                    ]
            ],
                "CognitoUserPool": [
                    "Default": [
                        "PoolId": poolId,
                        "AppClientId": appClientId,
                        "AppClientSecret": appClientSecret,
                        "Region": "aws-region"
                    ]
            ],
                "Auth": [
                    "Default": ["authenticationFlowType": "USER_SRP_AUTH"]
            ]
        ]

As for our initialization code, here's a draft of how we initialize the client:

public final class MobileClient {

    private var mobileClient: AWSMobileClient?

    private var appSyncClient: AWSAppSyncClient?

func getMobileClient() -> AWSMobileClient? {
let client = AWSMobileClient(configuration: configuration)
client.initialize { [weak self] userState, error in
            if let error = error {
                return nil
            }
            
            guard self?.appSyncInit(cognitoUserPoolsAuthProvider: client) == true else {
                return nil
            }
            
            do {
            appSyncClient = try AWSAppSyncClient(cognitoUserPoolsAuthProvider: client)
        } catch {
            return nil
        }
            DispatchQueue.main.async {
                client.addUserStateListener(self) { userState, _ in
            switch userState {
            case .guest:
                //print log
                
            case .signedOut:
                 //print log
                
            case .signedIn:
                 //print log
                
            case .signedOutUserPoolsTokenInvalid:
                //print log
                self.signOut { error in
                    if let error = error {
                         //print log
                    }
                }
                
            case .signedOutFederatedTokensInvalid:
                 //print log
                
            default:
                 //print log
            }
        }
            }
        }
}
mobileClient = client
return client
}

Please let m know if there are any more information I can provide.

from aws-mobile-appsync-sdk-ios.

atierian avatar atierian commented on July 18, 2024

Can you please provide the full crash report? Thanks!

from aws-mobile-appsync-sdk-ios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.