Hi Andre,
I did the following:
1. Create plugin with this conf:
{
"plugin" :{
"url": "https://github.com/Telerik-Verified-Plugins/Amazon-AWS.git#1.1.0",
"variables": [
{
"name": "ACCESS_KEY",
"value": "YOUR ACCESS KEY HERE"
},
{
"name": "SECRET_KEY",
"value": "YOUR SECRET KEY HERE"
}
]
}
}
2. Created a demo app with reference to the previous plugin with the following "OnApplicationReady"

3. Created a screen to list the files on a button click:

4. Configured CORS on bucket
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="https://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>PUT</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>GET</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
5. Uploaded a file to the bucket and test it on a phone

I didn't try to upload a file but the connection to S3 was OK.
Hope it can help.
Cheers,
Renato
Andre Paula wrote:
Renato Torres wrote:
Hi Andre,
One way is to use a Cordova plugin to interact directly with S3 from the phone, like the following:
https://plugins.telerik.com/cordova/plugin/amazon-aws
There is a training lesson that shows how to use Cordova Native Plugins:
https://www.outsystems.com/learn/lesson/1185/using-cordova-native-plugins/
Cheers,
Renato
Hey Renato,
Thanks for the fast reply.
However I'm having a problem that I dont undertand just to list the objects. The error says "cannot read property 'config' of undefined" but I think I'm importing correctly the plugin, like I did in others like the https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-media-capture/ and doing what its said.
On the extensibility options:
{
"plugin":
{
"identifier": "aws-sdk",
"url": "https://github.com/Telerik-Verified-Plugins/Amazon-AWS",
"variables": [{
"name": "ACCESS_KEY",
"value": "<my acess key>"
},
{
"name": "SECRET_KEY",
"value": "<my secret key>"
}]
}
}
On the javascript function (list objects):

Do you know whats the problem? I think the var AWS = require('aws-sdk'); is not working, but I don´t understand why.
Also, don´t understand how can I use the filePath of the mobile to upload directly, since there isnt any option to do that on the API, only binary data.