AWS Cognito ERROR Authenticator - No userPool - react-native

I'm trying to set up User Sign-in with AWS Cognito on React Native. I've followed these instructions:
http://docs.aws.amazon.com/aws-mobile/latest/developerguide/react-native-add-user-sign-in.html
I'm able to post analytics about the app and see a chart with data on AWS Pinpoint, but Cognito does not seem to be working
Things I've tried:
redownloading aws-exports.js
awsmobile pull

I figured it out. You have to configure Amplify before calling withAuthenticator(App). I just put it up at the top with the imports. It would have been nice if the tutorial mentioned this...
import Amplify from 'aws-amplify-react-native';
import aws_exports from './aws-exports';
import { withAuthenticator, API } from 'aws-amplify-react-native';
Amplify.configure(aws_exports);

Related

How to logout from facebook using expo-facebook

I have been trying to logout/end the session of the current logged in user so that any other user can login. https://docs.expo.dev/versions/latest/sdk/facebook/#logoutasync expo-facebook provides logOutAsync() method but its not working. How can I logout programmatically? is there any graphQl API, unable to find any.
You should import expo facebook
import * as Facebook from 'expo-facebook';
and call logOutAsync
Facebook.logOutAsync();

AWS Amplify withAuthenticator HoC - social media login?

I am using AWS Amplify Authentication on my React Native app using the withAuthentication HoC. I would like to implement federated signin with Google and Facebook which has already been configured on these platforms. Unfortunately I have no idea how I implement social media buttons on the AWS UI component; AWS documentation suggests that configuration is passed to the HoC, but no further information is provided...
export default withAuthenticator(App, {
// display federation/social provider buttons
federated: {myFederatedConfig},
})
Your help would be much appreciated!

Adding auth with aws amplify to an existing javascript project

So I have working app hosted on aws as static website. Currently it is publicly available, but I wanted to have authentication mechanism, so when user is not currently logged in it will show him login page instead. From following the aws documentation it seems that process requires to have some of additional front end frameworks such as react, vue etc? Is it possible to just use plain javascript to achieve the same results?
You can use the built in components for React, Vue and Angular.
If your app does not use these frameworks, its still possible to use vanilla js.
You need to import
import { Auth } from 'aws-amplify';
Then you can use the methods on the Auth class (https://aws-amplify.github.io/amplify-js/api/classes/authclass.html) independent of the react etc. controls.
For example, to sign up, you would use Auth.signUp and to sign in, you would use Auth.signIn
The AWS documentation for this is at https://docs.amplify.aws/lib/auth/emailpassword/q/platform/js

Delete the user pool added by AWS Amplify

I'm developing a React Native app and using AWS Amplify with Amazon Cognito for authentication. I've added the authentication for the app using Amplify CLI (amplify add auth). The problem is I need to add/remove the required attributes for the sign up, but those cannot be changed after the user pool is created.
My question is how can I delete the currently added user pool using the CLI, and making sure that the changes are reflected in aws-exports.js?
I figured it out. As mentioned here, it's not in amplify-cli docs, but you can remove a single category (in this case auth) like this:
amplify remove <category>
So, in this case, it would be
amplify remove auth
And, then
amplify push
aws cognito-idp delete-user-pool --user-pool-id youruserpoolid

AWS Pinpoint : Active targetable endpoints is Nul

I integrated AWS Amplify into my project react native. I use facebook Account Kit for connecting users. I'm having problems with aws pinpoint.
The analytics module works very well
the push notification module does not work very well:
the golds of tests to know to send a push notification according to the token FCM, I receive very well the message push notification.
In the dashboard impossible, you can not create segments or campaigns because "Active targetable endpoints is 0". What should I
do please? I need your help.
Package
aws-amplify: 1.1.7
aws-amplify-react-native: 2.0.7
# aws-amplify / pushnotification: 1.0.16
Sincerely
the endpoint should be automatically updated with the FCM token by Amplify when you opened the app. You can verify it by looking into the debug info.