· 8 years ago · Nov 19, 2017, 07:12 PM
1var AWSSignature = require('react-native-aws-signature');
2var awsSignature = new AWSSignature();
3var source1 = {uri: response.uri, isStatic: true}; // this is uris which got from image picker
4 console.log("source:"+JSON.stringify(source1));
5 var credentials = {
6 SecretKey: ‘security-key’,
7 AccessKeyId: ‘AccesskeyId’,
8 Bucket:’Bucket_name’
9 };
10 var options = {
11 path: '/?Param2=value2&Param1=value1',
12 method: 'POST',
13 service: 'service',
14 headers: {
15 'X-Amz-Date': '20150209T123600Z',
16 'host': 'xxxxx.aws.amazon.com'
17 },
18 region: ‘us-east-1,
19 body: response.uri,
20 credentials
21 };
22 awsSignature.setParams(options);
23 var signature = awsSignature.getSignature();
24 var authorization = awsSignature.getAuthorizationHeader();
25
26npm install aws-amplify-react-native