0

I am writing an app using Expo. I will create forms that will take various strings as data and take photos saving them to the app and then send it using AWS Amplify.

There will be multiple forms stored on the device, with those uploaded marked as "complete".

I have access to AsyncStorage from Expo and I was thinking of storing the forms on the device and then using AWS Amplify to send the data.

I am wondering if this is good practice to use AyncStorage as the documentation states it should only be used as a simple storage solution as it is global, although I do believe my needs are simple.

Are there any other options you could recommend that involve sending data to amazon web services?

1 Answer 1

1

I don't know if you understand AWS Amplify correctly. Where do you want to send the data to?

Amplify has three main parts: developer tools, CLI and framework.

The developer tools currently just supply the (awesome) Amplify console to simplify your hosting. The CLI helps you generate resources. And the framework part gives you code to use UI components and simplify the communication with your backend.

If you want to send it to a custom GraphQL endpoint, it's pretty good.

If you are using DynamoDB with AppSync and S3 AWS Amplify is awesome for the job.

If you don't have a backend yet, Amplify is also great for you.

Here is how you can generate a backend to save you form data in a DynamoDB and communicate with that NoSQL database using Amplify with AppSync.

Initialize Amplify:

amplify init 

Add auth:

amplify add auth 

And create the AppSync backend together with the DynamoDB:

amplify add api 

When asked to edit the schema, enter y for yes and edit it to your needs.

Then to send you form data you can simply do

async function sendFormData(formData) { const res = await API.graphql(graphqlOperation(createFormData, { input: formData })); console.log(res); } 
Sign up to request clarification or add additional context in comments.

2 Comments

So the issue is that I want to store them locally before I send my data to AWS using the Amplify library, and I'm trying to work out what the best way of doing that is. While I have this locally stored data, is the AsyncStorage library from Expo ok for that?
Yes. If you don't want to do it manually, try Redux with Redux persist.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.