Closed hszeto closed 6 years ago
Hi, I'm unsure as to whether this will be of any help to you but if you're looking to do user pool login/sign up within React Native using Cognito you can use the amazon-cognito-identity-js JS library which can be found at https://github.com/aws/amazon-cognito-identity-js
Primarily you'll be interested in looking at Use Case 4 within the documentation: https://github.com/aws/amazon-cognito-identity-js#usage
If you're wondering on how to integrate it with React Native, I've literally just finished getting a working model built up (after much hair pulling) - I've written a basic guide of the bits I could remember which can be found here: https://github.com/aws/amazon-cognito-identity-js/issues/327
I'm not going to say its a perfect integration and it requires modifying the cognito library but it appears to work from what I can see so far...still early days - I'm just waiting to run into my next bug!
Hope that helps
Thanks @npalethorpe ! Could you fix the link? they redirect me to a 404 page.
@hszeto sorry about that - links are updated! :)
@npalethorpe, that's great effort, thanks! Question - since this is based on the Cognito JS, it has no native components does it? All authentication tasks happen on the single JS thread?
@namankumar thanks :) - it has no native components; just javascript. I have replaced the localStorage methods (Which wouldn't work in React Native) with AsyncStorage, which as it sounds; is Asynchronous - but its still single threaded.
@hszeto Just published this: https://github.com/AirLabsTeam/react-native-aws-cognito-js/. It's based off Amazon Cognito Identity SDK for JavaScript using the new React Native branch of the AWS SDK for JavaScript.
They also released aws-mobile-react-native-starter which will give you a example of what you want... does anybody know how to integrate with facebook login tho?
Please also take a look at the new library which we released to address these scenarios: https://github.com/aws/aws-amplify
Coming from Firebase Auth, the AWS Cognito seems quite overwhelming. Does anyone have a good example/tutorial/doc that they can share for just a basic user signup and login with Cognito in React Native. (Not oauth-ing with facebook) Thanks.