aws-amplify

How to get unseen, nearby documents from a Amplify - AppSync - ElasticSearch - DynamoDB Stack?

我怕爱的太早我们不能终老 提交于 2019-12-23 04:52:14
问题 Problem: Use Amplify.js from AWS. A Tinder similar app. Here you can find jobs close by. These may only be seen once. We should save what the user likes and dislikes. What I've already managed: I have the scheme: type Query { nearbyJobs(location: LocationInput!, km: Int): ModelJobConnection } type User @model { id: ID! name: String interacts: [Jobinteract] @connection(name: "interactsuser") createdAt: String updatedAt: String } type Job @model @searchable { id: ID! name: String location:

React Native Image Upload via aws Amplify using Storage class

戏子无情 提交于 2019-12-21 02:13:22
问题 I have an image. I want to upload it to S3 using aws-amplify. All the Storage class upload examples are using text documents; however, I would like to upload an image. I am using expo which does not have support from react-native-fetch-blob, and react native does not have blob support... yet. So my options seem to be: Create a node service via lambda. Upload only the base64 info to S3 and not a blob. const { status } = await Permissions.askAsync(Permissions.CAMERA_ROLL); if (status ===

AppSync: Get user information in $context when using AWS_IAM auth

主宰稳场 提交于 2019-12-18 11:10:56
问题 In AppSync, when you use Cognito User Pools as your auth setting your identity you get identity: { sub: 'bcb5cd53-315a-40df-a41b-1db02a4c1bd9', issuer: 'https://cognito-idp.us-west-2.amazonaws.com/us-west-2_oicu812', username: 'skillet', claims: { sub: 'bcb5cd53-315a-40df-a41b-1db02a4c1bd9', aud: '7re1oap5fhm3ngpje9r81vgpoe', email_verified: true, event_id: 'bb65ba5d-4689-11e8-bee7-2d0da8da81ab', token_use: 'id', auth_time: 1524441800, iss: 'https://cognito-idp.us-west-2.amazonaws.com/us-west

Restrict login to Enterprise Google Domain for AWS Federated Identity Pool

不羁的心 提交于 2019-12-14 04:16:42
问题 I'm using a federation identity pools with aws-amplify (https://aws.github.io/aws-amplify/media/authentication_guide#enabling-federated-identities) and I'd like to restrict the scope of domains to just my google domain organization (ex. johndoe@foobar.com). There doesn't seem to be a way to lock it down on either the Google API console or the AWS Cognito Identity Pool settings, just a hint that an hd parameter can be appended to the google request to restrict it by domain (which would still

aws-amplify api.get federateInfo with options undefined error

邮差的信 提交于 2019-12-14 01:31:39
问题 I am playing around with aws-amplify and react-native. I am trying to make an api.get call on my home screen but keep running into the error: Get item: key is federatedInfo with options undefined I am calling an aws-api-gateway dynamodb. I have been looking at fixes with docs but most point to using HOC withAuthenticator. I don't want to do this since i've custom built signIn/signUP/Confirm screens. Any help or just a point in the right direction would be great. Here is my Home.screen code:

aws-amplify-react Connect returns undefined data first

时光怂恿深爱的人放手 提交于 2019-12-13 14:58:50
问题 I have the following setup: aws-amplify-react appsync create-react-app and following this documentation: https://aws.github.io/aws-amplify/media/api_guide#connect As in the doc, rendering this gives me 2x undefined data before returning the correct data. This breaks the app, as nested fields (in my example, e.g. getRoom.id ) cannot be accessed. Component example: export const AppSyncTest = () => ( <Connect query={graphqlOperation(query)}> {({ data: { getRoom } }) => { console.log(getRoom); //

How to access additional AWS resources from within an Amplify generated Lambda function?

浪尽此生 提交于 2019-12-13 03:55:55
问题 I've been playing around with AWS Amplify. Being relatively new to AWS I'm a huge fan of how Amplify provisions the necessary resources and IAM roles on AWS for me. My question is in regards to using Lambda with GraphQL. Following the documentation I'm able to create a custom GraphQL query that calls a Lambda function and returns a GraphQL response. However, I can't find anywhere in the documentation on how to interact with other AWS resources from within this Lambda function. For example, I

react native - Upload video to AWS S3 storage using AWS Amplify

爷,独闯天下 提交于 2019-12-13 03:46:06
问题 I am trying to upload a video to AWS S3 by using AWS Amplify in React native. I am able to upload an image when follow this link: aws-amplify Upload image using PUT in Storage I apply the same code to upload a video and success. However, the app crash if the video's size is big. According to the example, they read and convert the image/video file to base64 (consume memory a lot and even cause the app crash) then upload everything on the server. UPDATE I found the answer using blob from this

How to get and pass deviceKey in social login using Cognito and AWS Amplify?

人盡茶涼 提交于 2019-12-13 03:12:20
问题 I am trying to use the function setDeviceStatusRemembered from Cognito in the social login, but it needs a deviceKey, which is not available in the user object returned. The project is made using React. I already tried some responses from StackOverflow and docs, but no success. The user is handled and created by Amazon via OAuth in social login, and after login, I am getting the user data with this: const cognitoUser = await Auth.currentAuthenticatedUser() After, the object cognitoUser shows

Is it possible to customize default Sign Up, Sign In screens of aws-amplify-react-native package?

旧时模样 提交于 2019-12-13 01:03:25
问题 In order to have default auth screen, I can merely do this (https://github.com/aws-samples/aws-mobile-react-native-starter): import { withAuthenticator } from 'aws-amplify-react-native'; export default withAuthenticator(App); And I get pretty ugly default out-of-the-box login screen: Then docs say I can't modify default, I have to create my own (https://github.com/aws-samples/aws-mobile-react-native-starter): You can either use this Higher Order Component, or build your own UI and use the