Closed Intelbis closed 2 years ago
Because you are getting this error in ios do you mind running the app from xcode and seeing if there are any errors in xcode console? If you see any errors do you mind posting them here? Also do you mind posting your amplifyconfiguration.dart file (with any api keys or other values redacted)?
Hi i rearrange my code just in the main. How to configure ampliyAuthUI and datastore crud functions in one amplify configuration? We can only configure it once right?
const amplifyconfig = ''' {
"UserAgent": "aws-amplify-cli/2.0",
"Version": "1.0",
"api": {
"plugins": {
"awsAPIPlugin": {
"removalist": {
"endpointType": "GraphQL",
"endpoint": "end-point",
"region": "ap-southeast-2",
"authorizationType": "AMAZON_COGNITO_USER_POOLS",
"apiKey": "api-key"
}
}
}
},
"auth": {
"plugins": {
"awsCognitoAuthPlugin": {
"UserAgent": "aws-amplify-cli/0.1.0",
"Version": "0.1.0",
"IdentityManager": {
"Default": {}
},
"AppSync": {
"Default": {
"ApiUrl": "https://j2632ce4znfz3gpt5vtgw5qzzm.appsync-api.ap-southeast-2.amazonaws.com/graphql",
"Region": "ap-southeast-2",
"AuthMode": "AMAZON_COGNITO_USER_POOLS",
"ClientDatabasePrefix": "removalist_AMAZON_COGNITO_USER_POOLS"
},
"removalist_AWS_IAM": {
"ApiUrl": "https://j2632ce4znfz3gpt5vtgw5qzzm.appsync-api.ap-southeast-2.amazonaws.com/graphql",
"Region": "ap-southeast-2",
"AuthMode": "AWS_IAM",
"ClientDatabasePrefix": "removalist_AWS_IAM"
},
"removalist_API_KEY": {
"ApiUrl": "https://j2632ce4znfz3gpt5vtgw5qzzm.appsync-api.ap-southeast-2.amazonaws.com/graphql",
"Region": "ap-southeast-2",
"AuthMode": "API_KEY",
"ApiKey": "da2-api-key",
"ClientDatabasePrefix": "removalist_API_KEY"
}
},
"CredentialsProvider": {
"CognitoIdentity": {
"Default": {
"PoolId": "pool-id",
"Region": "ap-southeast-2"
}
}
},
"CognitoUserPool": {
"Default": {
"PoolId": "poolid",
"AppClientId": "clientid",
"Region": "ap-southeast-2"
}
},
"Auth": {
"Default": {
"authenticationFlowType": "USER_SRP_AUTH",
"socialProviders": [],
"usernameAttributes": [
"EMAIL"
],
"signupAttributes": [],
"passwordProtectionSettings": {
"passwordPolicyMinLength": 8,
"passwordPolicyCharacters": [
"REQUIRES_LOWERCASE",
"REQUIRES_NUMBERS",
"REQUIRES_SYMBOLS",
"REQUIRES_UPPERCASE"
]
},
"mfaConfiguration": "OFF",
"mfaTypes": [
"SMS"
],
"verificationMechanisms": [
"EMAIL"
]
}
}
}
}
}
}''';
Because you are getting this error in ios do you mind running the app from xcode and seeing if there are any errors in xcode console? If you see any errors do you mind posting them here? Also do you mind posting your amplifyconfiguration.dart file (with any api keys or other values redacted)?
hey Travis please see the code below for my latest changes in the main and my configuration has been posted in the previous post
Because you are getting this error in ios do you mind running the app from xcode and seeing if there are any errors in xcode console? If you see any errors do you mind posting them here? Also do you mind posting your amplifyconfiguration.dart file (with any api keys or other values redacted)?
Hi I successfully managed to implement auth and crud ops together. But I am facing another minor issue that I have to close and open the app to see changes in the app when i create a new Todo from the amplify content. Please let me know how to fix this I really appreciate the help thank you!
@Intelbis Can you confirm that the callback for this subscription is not called when a new item is added?
_subscription = Amplify.DataStore.observeQuery(Todo.classType)
.listen((QuerySnapshot<Todo> snapshot) {
setState(() {
if (_isLoading) _isLoading = false;
_todos = snapshot.items;
});
If that is the case, I think @ragingsquirrel3's suggestion is a good next step. If you can run the app from Xcode and include any logs that would be helpful. Thanks.
@Intelbis Can you confirm that the callback for this subscription is not called when a new item is added?
_subscription = Amplify.DataStore.observeQuery(Todo.classType) .listen((QuerySnapshot<Todo> snapshot) { setState(() { if (_isLoading) _isLoading = false; _todos = snapshot.items; });
If that is the case, I think @ragingsquirrel3's suggestion is a good next step. If you can run the app from Xcode and include any logs that would be helpful. Thanks.
Hi Thanks for the reply Jordan. I was able to solve this issue successfully with the default Todo properties in the Doc but the issue Im facing now is that I tried adding a new property and deployed it. But now the it it says failed to sync on amplify. In the log it shows "Orchestrator transitioning from SYNC_VIA_API to LOCAL_ONLY" "Setting currentState to LOCAL_ONLY" "Stopping subscription processor." "No more active subscriptions. Closing web socket." I have posted this as a new issue here. Thanks for the help :)
Okay, I am glad you were able to resolve this issue. I will close this one out and take a look at the new issue you opened.
Description
I have added the Amplify auth ui and CRUD Operations using the amplify docs. There are no run time errors in the code. The app loads on the phone and lets me sign in to the TodosPage. It lets me add a new todo and to save it and I can see all the list items but its not syncing to the cloud. The content section of amplify keeps loading. Any work around for this to view the data in amplifyStudio?
Categories
Steps to Reproduce
See reproduction app:
Screenshots
No response
Platforms
Android Device/Emulator API Level
No response
Environment
Dependencies
Device
Pixel 5
OS
Android 12
Deployment Method
Amplify CLI
CLI Version
No response
Additional Context
No response
Amplify Config