6

I have build a simple function in AWS Lambda which sends sms using Twilio service. I now want to call that function from my React-Native app. Do you have any suggestion to that?

1 Answer 1

4

There are two ways to invoke the AWS Lambda from your React-Native application

Direct invocation using AWS browser SDK

You can use lambda#invoke API to invoke your Lambda function from your React-Native app. Catch here is that you'll have to ship AWS credentials with your app. These credential will have permission to invoke the Lambda function.

Indirect onvocation using API Gateway

You can gate your Lambda function behind an API Gateway (API Gateway + Lambda integration). Then you can use standard JavaScript HTTP utilities to make REST calls to you API Gateway resource. This API Gateway resource will be responsible for invoking your Lambda function.

I prefer second method because API Gateway provides throttling support and we don't have to ship credentials with the app.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.