Giter VIP home page Giter VIP logo

aws-sdk-react-native's Introduction

Attention: Please use the AWS Amplify library for React Native development of new projects on AWS.

We've also released a React Native starter kit at https://github.com/awslabs/aws-mobile-react-native-starter. This kit demonstrates a working React Native app with the following services:

  • Amazon Cognito User Pools
  • Amazon Cognito Federated Identities
  • Amazon API Gateway
  • AWS Lambda
  • Amazon DynamoDB
  • Amazon S3
  • AWS Mobile Hub

This developer preview is currently under review and we will be looking to merge the contents in the future under a single repository for all AWS React Native functionality. In the meantime, we recommend you leverage the AWS Amplify library or the AWS JavaScript SDK with React Native support.

-- AWS team (November 18th, 2017)


AWS SDK for React Native

We’re excited to offer a developer preview of the AWS SDK for React Native. The SDK includes support for the following services:

  1. Amazon S3 to store user data, including photos and videos, in the cloud. It uses the TransferUtility, which simplifies file transfers between your app and the cloud.
  2. Amazon DynamoDB to store data into a NoSQL database.
  3. AWS Lambda to run serverless code in the cloud without the need for backend infrastructure.
  4. Amazon SNS to send and receive push notifications.

The SDK core uses Amazon Cognito Identity as the authentication provider to comply with best practices for mobile app development.

Contributions

Contributions are welcome! Please report issues using the Github issue tracker. To contribute, submit a pull request to the GitHub repository with a description of your issue or suggested change. If this is a bug fix, please reference the issue and include steps to reproduce it.

Set Up your Environment

  1. Install Xcode, Android Studio, and other dependencies based on the React Native Getting Started guide.
  2. Check out the SDK source code.

Build the SDK

  1. Run npm pack for Core.
  2. Run npm install for each service.

iOS only

  1. Download the AWS Mobile SDK for iOS and extract the frameworks.
  2. For each service, copy the relevant .framework into the iOS/Frameworks folder.
  3. Build each Xcode project. You may need to adjust the header search path.

License

The source code is available under the Apache 2.0 license.

aws-sdk-react-native's People

Contributors

adrienjt avatar appwiz avatar bengood362 avatar hyandell avatar jhen0409 avatar karthiksaligrama avatar markbiddlecom avatar patw0929 avatar pentateu avatar sohamdodia avatar undefobj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aws-sdk-react-native's Issues

<AWSframework> framework not found.

I'm trying to use the aws-sdk-react-native.

  1. I downloaded the SDK into ~/Documents/AWSSDK to maintain the same criteria as in FacebookSDK.
  2. I copied the frameworks I wanted to use, I started with all of them, but due to the error I started removing one by one with no luck.

This is the error I am getting (In this case its for AWSCore but it will be any eventually):

ld: framework not found AWSCore
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I'd say the instructions could be better. Does anyone succeeded setting this up? Any example?

Thanks!

Basic authentication example?

Coming from Firebase Auth, the AWS Cognito seems quite overwhelming. Does anyone have a good example/tutorial/doc that they can share for just a basic user signup and login with Cognito in React Native. (Not oauth-ing with facebook) Thanks.

No visible @interface for filetransferutility

Helo All,

I am trying to install the filetranferutility following instrucitons here: #35

I started getting the bellow error when I trying to launch .. any help is greatly appreciated. Thank you.

apps/reactnative/TestAppRu /node_modules/aws-sdk-react-native-transfer-utility/ios/AWSTransferUtility/AWSRNS3TransferUtility.m:127:23: No visible @interface for 'AWSS3TransferUtility' declares the selector 'downloadToURL:bucket: key:expression:completionHander:'

Lambda client only supports JSON?

I'm trying to integrate the Lambda client into a project where my lambda function on invocation returns binary data, in this case PDF.

From what I can tell it looks like the native code supporting the Lambda client only supports JSON. Is that correct?

Core project bug - Cognito RCTJSONStringify errors (NSTaggedDate, __NSMallocBlock__)

Hi,
I've banged my head for a few hours on this issue when integrating with my project - and it seems that the reference example project is also broken. The issue is this block in the example/index.js

async function getCredAndID(){
      try{
        var variable = await AWSCognitoCredentials.getCredentialsAsync();
        that.setState({AccessKey:variable["AccessKey"],SecretKey:variable["SecretKey"],
        SessionKey:variable["SessionKey"],Expiration:variable["Expiration"].toString()});
        variable = await AWSCognitoCredentials.getIdentityIDAsync();
        that.setState({identityID:variable.identityid});
      }catch(e){
        console.log("Error: " + e)
        return;
      }
    }

Specifically, the line:

var variable = await AWSCognitoCredentials.getCredentialsAsync();

Always results in an error as follows:

screen shot 2016-09-01 at 8 19 59 pm

And the error in plain text:

2016-09-01 20:17:29.399 example[95700:996058] *** -[NSLock lock]: deadlock (<NSLock: 0x7f87ab57c3b0> '(null)')
2016-09-01 20:17:29.399 example[95700:996058] *** Break on _NSLockError() to debug.
2016-09-01 20:17:29.400 [error][tid:com.facebook.react.WebSocketExecutor][RCTUtils.m:80] RCTJSONStringify() encountered the following error: Invalid type in JSON write (__NSMallocBlock__)

Looks like the bundled library is trying to send an event with a "block" payload. Then, you have another bug, which I found only when I modified the AWSCognitoCredentials.m - you can't do this in react native:

RCT_EXPORT_METHOD(getCredentialsAsync:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject){
    [[credentialProvider credentials] continueWithBlock:^id(AWSTask *task) {
        if (task.exception){
            dispatch_async(dispatch_get_main_queue(), ^{
                @throw [NSException exceptionWithName:task.exception.name reason:task.exception.reason userInfo:task.exception.userInfo];
            });
        }
        if (task.error) {
            reject([NSString stringWithFormat:@"%ld",task.error.code],task.error.description,task.error);
        }
        else {
            AWSCredentials *cred = (AWSCredentials*) task.result;
            NSDictionary *dict = @{@"AccessKey":cred.accessKey,@"SecretKey":cred.secretKey,@"SessionKey":cred.sessionKey,@"Expiration":cred.expiration};
            resolve(dict);
        }
        return nil;
    }];
}

You are sending an NSTaggedDate (NSDate) here: cred.expiration, which is not serializable by the RCT Bridge! I never got it working, (the example) - otherwise I would have submitted a pull request but I'm a green ObjC dev.

I really hope that it's just me and that the underlying framework is not buggy - as I really need this project :)

Thanks

Repository URL typo

Minor issue, not github.com/aws/~ but github.com/awslabs/~
2. Check out the [SDK source code](https://github.com/aws/aws-sdk-react-native).

Refresh access

Hi
Thanks for the great work.
I'm having a hard time achieving the following once a user is logged in with Facebook

  1. What do I have to code to avoid a disconnection from Cognito after 1h?
  2. What do I have to code to get a connection back when I close/reopen the app?
    Integration of these in the documentation would be a huge plus!
    Thanks

Unable to successfully call AWSDynamoDB.Query

I am calling AWSDynamoDB.Query with the following options:

{"TableName":"MyTable", "KeyConditionExpression":"ID=:id","ExpressionAttributeValues":{":id":"MyValue"}}

In AWSRNDynamoDBClient.Query the following exception is thrown when creating QueryResult:

com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 38 path $.ExpressionAttributeValues.

It really seems like my parameters are correct, so I modified AWSRNDynamoDBClient::Query to manually build the request for those given parameters

QueryRequest request;
if(options.hasKey("TableName") && options.hasKey("KeyConditionExpression") && options.hasKey("ExpressionAttributeValues")) {
    request=new QueryRequest();
    request.setTableName(options.getString("TableName"));
    request.setKeyConditionExpression(options.getString("KeyConditionExpression"));

    java.util.Map<String, AttributeValue> expressionAttributeValues = new java.util.HashMap<>();
    ReadableMap expressionAttributeValueMap = options.getMap("ExpressionAttributeValues");
    ReadableMapKeySetIterator expressionAttributeValueMap_itr = expressionAttributeValueMap.keySetIterator();
    while (expressionAttributeValueMap_itr.hasNextKey()) {
        String key = expressionAttributeValueMap_itr.nextKey();
        expressionAttributeValues.put(key, new AttributeValue(expressionAttributeValueMap.getString(key)));
    }

    request.setExpressionAttributeValues(expressionAttributeValues);
}
else
    request = gson.fromJson(new JSONObject(AWSRNClientMarshaller.readableMapToMap(options)).toString(), QueryRequest.class);

With that code, the request is correctly built and properly queries the DynamoDB.
Obviously that code isn't production quality, but I believe it shows that the incoming options are correctly formatted?

[Feature Request] Support for Basic Authentication

In my application of this package I need to publicly read from some database. For now I have chosen to use a DynamoDB and want to use this package to do the reading.

I do not provide a user-log in any way in my app, so authentication with only cognito isn't really applicable. I suppose I could set a up a single cognito user and have that user log-in "under the surface", but that is awkward.

My thought was to use a IAM user, configured to only have read access to database. To do this, the AmazonDynamoDBClient object would need to be constructed with BasicAWSCredentials (or AWSStaticCredentialsProvider) instance instead of CognitoCachingCredentialsProvider.

I think this is a pretty reasonable scenario that other users will surely encounter. Although I freely admit: I am somewhat new to AWS (and app development as a whole), so any recommendations are welcome.

To support my needs, I forked this repo and added changes to do Basic Authentication. That fork can be viewed here: https://github.com/MadisonBlake/aws-sdk-react-native. Note that I have not implemented ios support (yet), nor have I tested that my changes didn't break Cognito authentication.

iOS cognito credentials - expiration should be a string

I think there is a bug in ios/Core/AWSRNCognitoCredentials.m. It seems like cred.expiration is a date and not a string. I looked up the expiration string format and eventually got it working with this change (I can't program native iOS, so maybe someone else is better suited to create a pull request):

RCT_EXPORT_METHOD(getCredentialsAsync:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject){
    [[credentialProvider credentials] continueWithBlock:^id(AWSTask *task) {
        if (task.error) {
            reject([NSString stringWithFormat:@"%ld",task.error.code],task.error.description,task.error);
        }
        else {
            AWSCredentials *cred = (AWSCredentials*) task.result;
            NSDateFormatter *dateFormat = [[NSDateFormatter alloc]init];
            [dateFormat setDateFormat:@"yyyy-MM-ddTHH-mm-ss.SSZ"];
            NSString *expF = [dateFormat stringFromDate:cred.expiration];
            NSDictionary *dict = @{@"AccessKey":cred.accessKey,@"SecretKey":cred.secretKey,@"SessionKey":cred.sessionKey,@"Expiration":expF};
            resolve(dict);
        }
        return nil;
    }];
}

this sdk is not compatible with lastest aws sdk: 2.4.0

This morning aws sdk released 2.4.0. I compile my project again and got this:

Building and installing the app on the device (cd android && gradlew.bat install Debug)...
Download https://jcenter.bintray.com/com/amazonaws/aws-android-sdk-core/2.4.0/aw s-android-sdk-core-2.4.0.pom
Download https://jcenter.bintray.com/com/amazonaws/aws-android-sdk-pom/2.4.0/aws -android-sdk-pom-2.4.0.pom
Download https://jcenter.bintray.com/com/amazonaws/aws-android-sdk-core/2.4.0/aw s-android-sdk-core-2.4.0.jar
Download https://jcenter.bintray.com/com/amazonaws/aws-android-sdk-ddb/2.4.0/aws -android-sdk-ddb-2.4.0.pom
Download https://jcenter.bintray.com/com/amazonaws/aws-android-sdk-ddb/2.4.0/aws -android-sdk-ddb-2.4.0.jar
Download https://jcenter.bintray.com/com/amazonaws/aws-android-sdk-lambda/2.4.0/ aws-android-sdk-lambda-2.4.0.pom
Download https://jcenter.bintray.com/com/amazonaws/aws-android-sdk-lambda/2.4.0/ aws-android-sdk-lambda-2.4.0.jar
Download https://jcenter.bintray.com/com/amazonaws/aws-android-sdk-s3/2.4.0/aws- android-sdk-s3-2.4.0.pom
Download https://jcenter.bintray.com/com/amazonaws/aws-android-sdk-kms/2.4.0/aws -android-sdk-kms-2.4.0.pom
Download https://jcenter.bintray.com/org/apache/commons/commons-io/1.3.2/commons -io-1.3.2.pom
Download https://jcenter.bintray.com/org/bouncycastle/bcprov-jdk16/1.44/bcprov-j dk16-1.44.pom
Download https://jcenter.bintray.com/com/amazonaws/aws-android-sdk-kms/2.4.0/aws -android-sdk-kms-2.4.0.jar
Download https://jcenter.bintray.com/org/apache/commons/commons-io/1.3.2/commons -io-1.3.2.jar
Download https://jcenter.bintray.com/org/bouncycastle/bcprov-jdk16/1.44/bcprov-j dk16-1.44.jar
Download https://jcenter.bintray.com/com/amazonaws/aws-android-sdk-s3/2.4.0/aws- android-sdk-s3-2.4.0.jar
....
:app:dexDebugUnknown source file : UNEXPECTED TOP-LEVEL EXCEPTION:
Unknown source file : com.android.dex.DexException: Multiple dex files define Lo rg/apache/commons/io/CopyUtils;
Unknown source file : at com.android.dx.merge.DexMerger.readSortableTypes(DexM erger.java:596)
Unknown source file : at com.android.dx.merge.DexMerger.getSortedTypes(DexMerg er.java:554)
Unknown source file : at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerg er.java:535)
Unknown source file : at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.j ava:171)
Unknown source file : at com.android.dx.merge.DexMerger.merge(DexMerger.java:1 89)
Unknown source file : at com.android.dx.command.dexer.Main.mergeLibraryDexBuff ers(Main.java:502)
Unknown source file : at com.android.dx.command.dexer.Main.runMonoDex(Main.jav a:334)
Unknown source file : at com.android.dx.command.dexer.Main.run(Main.java:277)
Unknown source file : at com.android.dx.command.dexer.Main.main(Main.java:245)
Unknown source file : at com.android.dx.command.Main.main(Main.java:106)

FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:dexDebug'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.E xecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_101\bin\java.exe' ' finished with non-zero exit value 2

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Currently I hardcode the aws sdk version in node_module\aws-react-native-*\android\build.gradle

dependencies {
...
compile 'com.amazonaws:aws-android-sdk-core:2.3.9'
compile 'com.amazonaws:aws-android-sdk-lambda:2.3.9'
}

Hope there will be a release issuing this problem soon.

Syntax error in AWSCognitoCredentials

I'm getting a syntax error on this line.

If I understand correctly, it's destructuring callbackId from event, then passing that on to the arrow function. However, is this the correct syntax? I've just updated to the latest React Native version, and it still gives me the error.

Would this fix it?

Transfer Utility Code=2 "(null)" - iOS

Hi,

I'm trying to upload a picture to a S3 bucket on iOS, but on every first upload after app start the following error is returned in the completation handler. Then the next picture doesn't even start the upload (no info cames from progress callback)

"Error Domain=com.amazonaws.AWSS3TransferUtilityErrorDomain Code=2 "(null)" UserInfo={Server=AmazonS3, Transfer-Encoding=Identity, Connection=close, Content-Type=application/xml, Date=Tue, 08 Nov 2016 16:38:58 GMT, x-amz-request-id=A33BCEA53A29008B, x-amz-id-2=ew77OTuf2kBDt7ZKbZISzQLSex7oCU/ecKMgTFasY6+F2qtqjM4lKaZkEbQtXr36ncPU4IBdfKg=}"

Env: OSX El Capitan, XCode 8.1
Device: iPhone 6s Plus iOS 10

AWSCore error on Xcode

Hello,
I am trying to use AWS Cognito on my project but I keep having an issue importing the library.

I installed the current master branch to my node_modules package, linked, installed AWSCore as a cocoapod but still get the following error:

screen shot 2017-01-09 at 18 08 03 copy

screen shot 2017-01-09 at 17 45 34

Any idea?
Thanks

Can we use this tool to download the App bundle?

Wondering if this tool can be used to download the React Native app JS bundle from S3 like a deployment tool? The bundle shouldn't be available to public but just to the app. Appreciate any inputs on this.

Workflow:

  1. Build the RN app bundle on mac, upload it to S3 bucket.
  2. An app downloads the new bundle (when available: custom notification, automatic or custom logic) and makes the new deployment available to users

detail step-by-step guide

The official document of aws-sdk-react-native is too sparse and not easy to follow. I've been trying to set up the aws-sdk-react-native for two days. Finally it works! Here's the step-by-step guide for your reference.

I'm a web developer just step into native app development world. If there's anything wrong with following steps, please let me know. Thanks!

The guide should be able to fix #33, #24, #18, and #20.

build aws-sdk-react-native

you could skip this step and go ahead download form here.

  1. download AWS Mobile SDK for iOS here
  2. git clone https://github.com/awslabs/aws-sdk-react-native.git
  3. copy AWSCore.framework file to aws-sdk-react-native/Core/ios/Frameworks
  4. to fix #20, edit aws-sdk-react-native/Core/src/AWSCognitoCredentials.js, change line 48 from
    listener.addListener("LoginsRequestedEvent", async {callbackId} => {
    to
    listener.addListener("LoginsRequestedEvent", async ({callbackId}) => {
  5. cd aws-sdk-react-native/Core
  6. npm pack

install aws-sdk-react-native

  1. yarn add ../../path/to/aws-sdk-react-native-core-0.0.2.tgz
  2. react-native link aws-sdk-react-native-core

Then follow step2/step3/step4 of the official aws ios sdk guide.

  1. With your project open in Xcode, select your Target. Under General tab, find Embedded Binaries and then click the + button.

  2. Click the Add Other... button, navigate to the project_folder/node_modules/aws-sdk-react-native-core/ios/Frameworks/AWSCore.framework and select them. ( DO NOT check the Destination: Copy items if needed checkbox when prompted. it's already in the node_modules)

2017-01-12 10 08 15

  1. Under the Build Phases tab in your Target, click the + button on the top left and then select New Run Script Phase. Then setup the build phase as follows. Make sure this phase is below the Embed Frameworks phase.

     Shell /bin/sh
     
     bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/AWSCore.framework/strip-frameworks.sh"
     
     Show environment variables in build log: Checked
     Run script only when installing: Not checked
     
     Input Files: Empty
     Output Files: Empty
    
  2. Click on your main project file, select Build Settings, click 'Framework Search Paths', add $(SRCROOT)/../node_modules/aws-sdk-react-native-core/ios/Frameworks.

2017-01-12 13 15 35

  1. Build and run, that's it.

Better Instructions Needed

There are conflicting instruction on the various Amazon properties for how to get this working in React Native

Announcing the AWS SDK for React Native has one set of instructions
aws-sdk-react-native at GitHub has different instructions

Both are very sparse and not detailed enough for me.

In particular, it's not very clear how the packages on this site are supposed to interact with the SDK files. What gets compiled? What gets linked to the Xcode project, etc.

Could someone please writeup a step-by-step set of instructions to get setup and Authenticate with Cognito on iOS?

Thanks!

Cognito User Pool Authentication

Hi, I'm hoping someone can shed some light on my somewhat confused brain. I recently decided to ditch an app I was originally writing using Cordova/AngularJS and start again using React Native. I had a fully implemented Cognito integration using the official aws amazon-cognito-identity-js library in my Cordova app. That worked great. However I'm now in a bit of a ditch trying to figure out how to integrate authentication with a user pool, not Facebook twitter etc as shown in the example.

If anyone could indicate if this is even possible using this id be very grateful, and more so if someone could give me a quick walkthrough on how to do it. I've been lost in web articles for days now and I'm on the fence about if its even possible.
I'm considering attempting to implement the amazon-cognito-identity-js library however it uses localStorage and I'm unsure if that'll work with React Native.

Any help would be much appreciated.

Invalid file

I passed file path as argument in AWSS3TransferUtility.createUploadRequest({ path, like this Ex : file://data/user/0/my.package.name/cache/mypics/h.jpg

Integration of basic authentication to User Pool

Hello,

How can I do a basic authentication (e.g. get access token) to a user pool on Cognito ?

All I was able to see in the repo was connections to Identity Providers (such as Facebook...).

Thanks!

Developer authenticated identies

As far as I can tell this is not currently supported. Not too sure how this could work with the current setup.

let logins = {};
logins['cusom.provider.id'] = serverResponse.Token;
AWSCognitoCredentials.setLogin(logins)

Errors with: "Please provide a valid public provider"

Is this a workflow that could be supported, it doesn't seem to make sense to offload the authentication to a custom provider in native code for each platform.

The JS code makes the request and gets a valid IdentityId and Token, but doesn't seem to be a native way to then set that.

Lamda code not working

I was trying out the LambdaTest but getting the following error when I run that test. I changed the region and identity pool to what I use and a lamda that I wrote but those are the only changes the rest of the code is as per example. Please help as am not sure what I am doing wrong.

2017-01-12 17:56:08.034 [error][tid:com.facebook.react.AWSRNCognitoCredentialsQueue][RCTConvert.m:58] JSON value '{
callbackId = "6785E7DB-C758-4DE7-85B6-D0D814D5CC32";
}' of type NSMutableDictionary cannot be converted to NSString

Any documentation for PutItem?

I'm trying to use PutItem like the following

var params = {
TableName: "

",
Item: {
userId: "1",
name: "jaafar"
}
};

AWSDynamoDB.PutItem(params).then((response) => {
  console.debug("Success");
  console.debug(response);
}).catch((error) => {
  console.debug("failed");
  console.debug(error);
});

and im getting this

{ [Error: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 64 path $.Item.]
04-27 13:35:19.832 6937 7049 D ReactNativeJS: framesToPop: 1,
04-27 13:35:19.832 6937 7049 D ReactNativeJS: code: 'EUNSPECIFIED',
04-27 13:35:19.832 6937 7049 D ReactNativeJS: line: 19400,
04-27 13:35:19.832 6937 7049 D ReactNativeJS: column: 29,
04-27 13:35:19.832 6937 7049 D ReactNativeJS: sourceURL: 'http://10.0.2.2:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false' }

Getting more done in GitHub with ZenHub

Hola! @cagodoy has created a ZenHub account for the awslabs organization. ZenHub is the only project management tool integrated natively in GitHub – created specifically for fast-moving, software-driven teams.


How do I use ZenHub?

To get set up with ZenHub, all you have to do is download the browser extension and log in with your GitHub account. Once you do, you’ll get access to ZenHub’s complete feature-set immediately.

What can ZenHub do?

ZenHub adds a series of enhancements directly inside the GitHub UI:

  • Real-time, customizable task boards for GitHub issues;
  • Multi-Repository burndown charts, estimates, and velocity tracking based on GitHub Milestones;
  • Personal to-do lists and task prioritization;
  • Time-saving shortcuts – like a quick repo switcher, a “Move issue” button, and much more.

Add ZenHub to GitHub

Still curious? See more ZenHub features or read user reviews. This issue was written by your friendly ZenHub bot, posted by request from @cagodoy.

ZenHub Board

Roadmap?

Is there a roadmap for release?

Does it support background upload?

Hello! Im currently scavaging around trying to look for an aws react-native lib. I've already checked out the react-native-s3 and react-native-aws3. My question is if this library supports background upload/download on both iOS and android?

Amazon Rekognition

Hello,
Is it possible to access to Amazon Rekognition with this library ?

Thanks

Add support of Pinpoint SDK APIs

I know these APIs are fairly new, but they really make sense for react native clients.

Especially the notification integration and event tracking with batching/offline tracking make sense to use a native SDK vs a pure JS SDK.

NativeModules.AWSRNCognitoCredentials returns undefined

Trying to use Cognito, and following the example code, I end up with:

import React, {Component} from "react";
import View} from "react-native";

import {AWSCognitoCredentials} from 'aws-sdk-react-native-core';
import {AWSS3TransferUtility} from 'aws-sdk-react-native-transfer-utility';


class Sample extends Component {

    constructor(props) {
        super(props)


        ASCognitoCredentials.initWithOptions({"region": "XXX", "identity_pool_id": "YYY"})
    }

    render() {
        return (<View></View>)
    }
}

XCode produces the following error:

[fatal][tid:com.facebook.react.RCTExceptionsManagerQueue] Unhandled JS Exception: Cannot read property 'initWithOptions' of undefined

A little debugging, and it appears that in AWSCogniteCredentials.js the following returned: undefined.

var cognitoClient = NativeModules.AWSRNCognitoCredentials;

property 'exception' not found on object of type 'AWSTask *'

I followed the guide here, it works fine on Android, but on IOS I get the following error in XCode property 'exception' not found on object of type 'AWSTask *'

In both places the error is in task.exception

The error is here

RCT_EXPORT_METHOD(getCredentialsAsync:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject){

    //start a separate thread for this to avoid blocking the component queue, since
    //it will have to comunicate with the javascript in the mean time while trying to get the list of logins

    NSString* queueName = [NSString stringWithFormat:@"%@.getCredentialsAsyncQueue",
                           [NSString stringWithUTF8String:dispatch_queue_get_label(self.methodQueue)]
                           ];
    dispatch_queue_t concurrentQueue = dispatch_queue_create([queueName UTF8String], DISPATCH_QUEUE_CONCURRENT);

    dispatch_async(concurrentQueue, ^{

        [[credentialProvider credentials] continueWithBlock:^id(AWSTask *task) {
            if (task.exception){
                dispatch_async(dispatch_get_main_queue(), ^{
                    @throw [NSException exceptionWithName:task.exception.name reason:task.exception.reason userInfo:task.exception.userInfo];
                });
            }

and here

RCT_EXPORT_METHOD(getIdentityIDAsync:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject){
    [[credentialProvider getIdentityId] continueWithBlock:^id(AWSTask *task) {
        if (task.exception){
            dispatch_async(dispatch_get_main_queue(), ^{
                @throw [NSException exceptionWithName:task.exception.name reason:task.exception.reason userInfo:task.exception.userInfo];
            });
        }

Any ideas what might be wrong?

Is this library supported by AWS?

Given that the last commit was in October,2016 and that the library is in developer preview, I am hesitant to use AWS for my react-native mobile app. Is this library officially supported by Amazon? Why isn't this under active development? Thanks.

undefined is not an object (evaluating 'cognitoClient.initWithOptions')

Trying to test this out but running into an issue. At face value it appears that the NativeModules.AWSRNCognitoCredentials is not loading... but not sure if symptom or cause. Ideas?

Note I am running android simulation, and here is the abbrev. code:
...
import {AWSLambda} from 'aws-sdk-react-native-lambda';
import {AWSCognitoCredentials} from 'aws-sdk-react-native-core';

var functionName = "sampleFunction";
var cognitoRegion = "us-east-1";
var identity_pool_id = "us-east-1:xxxx";
var serviceRegion = "us-east-1";

...
async Setup() : Promise {
Promise.all([AWSCognitoCredentials.initWithOptions({"region":cognitoRegion,"identity_pool_id":identity_pool_id})]).then(()=>{
AWSLambda.initWithOptions({"region":serviceRegion});
});
return;
}

async _invokeRequest() {
await this.Setup();
var shouldResolve = false;
var req = {
"FunctionName" : function,
"InvocationType" : "RequestResponse",
"LogType" : "None",
"ClientContext" : this.encode(JSON.stringify({"System":"android"})),
"Payload" : JSON.stringify({"email":"testing1234"})
};
try{
console.log("testing...");
var response = AWSLambda.Invoke(req);
if(response.LogResult){
console.error("response.LogResult should not be present");
shouldResolve = false;
return shouldResolve;
}
if(!response.Payload){
console.error("response.Payload is not present");
shouldResolve = false;
return shouldResolve;
}
if(response.Payload.Length === 0){
console.error("response.Payload.Length is 0. Response payload length: " + response.Payload.Length);
shouldResolve = false;
return shouldResolve;
}
if(response.StatusCode === 0){
console.error("response.StatusCode is 0. Response code: " + response.StatusCode);
shouldResolve = false;
return shouldResolve;
}

 } catch(e) {
  console.error(e);
  shouldResolve = false;
  return shouldResolve;
 }

}
...

AWSCognitoCredentials.isAuthenticated returns "true" only on first authentication

RN version 0.37

Using AWSCognitoCredentials I'm finding that the method isAuthenticated returns true only the first time. Subsequent logins return false.

I'm using sample code I found in an Amazon GitHub repo, however have since been unable to locate the repo that has it.

//
// Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License").
// You may not use this file except in compliance with the License.
// A copy of the License is located at
//
// http://aws.amazon.com/apache2.0
//
// or in the "license" file accompanying this file. This file is distributed
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
// express or implied. See the License for the specific language governing
// permissions and limitations under the License.
//
const FBSDK = require('react-native-fbsdk');
const {
  LoginButton,
  AccessToken
} = FBSDK;
import React, { Component } from 'react';
import {AWSCognitoCredentials} from 'aws-sdk-react-native-core';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View,
  NativeModules,
  NativeAppEventEmitter
} from 'react-native';
var fbookToken = ''
var supplyLogins = false;

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },
  instructions: {
    textAlign: 'center',
    color: '#333333',
    marginBottom: 5,
  },
  fbButton: {
    borderColor: '#2d5073',
    backgroundColor: '#3b5998',
  },
  attribute: {
    fontSize: 5
  }
});

var region = YOUR_REGION_HERE;
var identity_pool_id = YOUR_ID_HERE

export default class example extends Component{
  constructor(props) {
    super(props);
    this.state = {
      loginMessage: 'Log Into Facebook',
      Authenticated:'False',
      identityID: '',
      AccessKey:'',
      SecretKey:'',
      SessionKey:'',
      Expiration:'',
      isLoggedIn: false
    };
    AWSCognitoCredentials.identityChanged = function(Previous,Current){
      console.log("PreviousID: " + Previous);
      console.log("CurrentID: " + Current);
    }
    AWSCognitoCredentials.getLogins = function(){
      if(supplyLogins){
        var map = {};
        map[AWSCognitoCredentials.RNC_FACEBOOK_PROVIDER] = fbookToken;
        return map;
      }else{
        return "";
      }
    };
  }
  Refresh(){
    var that = this;
    async function getCredAndID(){
      try{
        var variable = await AWSCognitoCredentials.getCredentialsAsync();
        that.setState({AccessKey:variable["AccessKey"],SecretKey:variable["SecretKey"],
          SessionKey:variable["SessionKey"],Expiration:variable["Expiration"].toString()});
        variable = await AWSCognitoCredentials.getIdentityIDAsync();
        that.setState({identityID:variable.identityid});
      }catch(e){
        console.log("Error: " + e)
        return;
      }
    }
    getCredAndID();
    AWSCognitoCredentials.isAuthenticated(function(error, variable){
      if(error){
        console.log("Error: " + error)
      }else{
        if (variable) {
          that.setState({Authenticated:"True"});
        }else{
          that.setState({Authenticated:"False"});
        }
      }
    });
  }
  ClearCred(){
    AWSCognitoCredentials.clearCredentials();
  }
  ClearKeychain(){
    AWSCognitoCredentials.clear();
  }
  onLoginInvoked(isLoggingIn, Accesstoken){
    that = this;
    if(isLoggingIn){
      fbookToken = Accesstoken;
      supplyLogins = true;
      AWSCognitoCredentials.initWithOptions({"region":region,"identity_pool_id":identity_pool_id})
      var map = {};
      map[AWSCognitoCredentials.RNC_FACEBOOK_PROVIDER] = fbookToken;
      AWSCognitoCredentials.setLogins(map); //ignored for iOS
      return;
    }else{
      supplyLogins = false;
    }
  }
  render() {
    return (
      <View style={styles.container}>
        <Text>is User Authenticated?: {this.state.Authenticated}</Text>
        <Text>Identity Id: {this.state.identityID}</Text>
        <Text>AccessKey: {this.state.AccessKey}</Text>
        <Text>SecretKey: {this.state.SecretKey}</Text>
        <Text>SessionKey: </Text><Text style={styles.attribute}>{this.state.SessionKey}</Text>
        <Text>Expiration: {this.state.Expiration}</Text>
        <View>
          <LoginButton
            onLoginFinished={
              (error, result) => {
                if (error) {
                  alert("login has error: " + result.error);
                } else if (result.isCancelled) {
                  alert("login is cancelled.");
                } else {
                  AccessToken.getCurrentAccessToken().then(
                    (data) => {
                      this.onLoginInvoked(true,data.accessToken.toString());
                    }
                  )
                }
              }
            }
            onLogoutFinished={() => this.onLoginInvoked(false,"")}/>
        </View>
        <Text onPress={this.Refresh.bind(this)}>
          Click Me To Refresh The View!!!
        </Text>
        <Text onPress={this.ClearCred.bind(this)}>
          Click Me To Clear Credentials!!
        </Text>
        <Text onPress={this.ClearKeychain.bind(this)}>
          Click Me To Clear Keychain!
        </Text>
      </View>
    );
  }
}

Building Core fails in xcode: 'React/RCTBridge.h' file not found

When I try to build the Core project in xcode, I am getting the error "'React/RCTBridge.h' file not found". I have tried adjusting the "Header Search Paths" and "User Header Search Paths" to point to various folders inside react-native/React, but nothing seems to work. I suspect the problem may be related to the fact that the react native headers are referenced as system headers ("#import <React/RCTBridge.h>"), but I'm lost as to how I can fix this. Any help or more detailed directions would be appreciated.

framework not found AWSCore for architecture x86_64

The following command produces the error:

Ld /Users/markotomic/Library/Developer/Xcode/DerivedData/NativebaseKitchenSink-elvnsdrsrbdwqtdvdsithdwuzlls/Build/Products/Debug-iphonesimulator/NativebaseKitchenSink.app/NativebaseKitchenSink normal x86_64
    cd /Users/markotomic/Documents/workspace_mobile/NativeBase-KitchenSink/ios
    export IPHONEOS_DEPLOYMENT_TARGET=8.0
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk -L/Users/markotomic/Library/Developer/Xcode/DerivedData/NativebaseKitchenSink-elvnsdrsrbdwqtdvdsithdwuzlls/Build/Products/Debug-iphonesimulator -F/Users/markotomic/Library/Developer/Xcode/DerivedData/NativebaseKitchenSink-elvnsdrsrbdwqtdvdsithdwuzlls/Build/Products/Debug-iphonesimulator -filelist /Users/markotomic/Library/Developer/Xcode/DerivedData/NativebaseKitchenSink-elvnsdrsrbdwqtdvdsithdwuzlls/Build/Intermediates/NativebaseKitchenSink.build/Debug-iphonesimulator/NativebaseKitchenSink.build/Objects-normal/x86_64/NativebaseKitchenSink.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=8.0 -Xlinker -object_path_lto -Xlinker /Users/markotomic/Library/Developer/Xcode/DerivedData/NativebaseKitchenSink-elvnsdrsrbdwqtdvdsithdwuzlls/Build/Intermediates/NativebaseKitchenSink.build/Debug-iphonesimulator/NativebaseKitchenSink.build/Objects-normal/x86_64/NativebaseKitchenSink_lto.o -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -ObjC -lc++ -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/markotomic/Library/Developer/Xcode/DerivedData/NativebaseKitchenSink-elvnsdrsrbdwqtdvdsithdwuzlls/Build/Intermediates/NativebaseKitchenSink.build/Debug-iphonesimulator/NativebaseKitchenSink.build/NativebaseKitchenSink.app.xcent /Users/markotomic/Library/Developer/Xcode/DerivedData/NativebaseKitchenSink-elvnsdrsrbdwqtdvdsithdwuzlls/Build/Products/Debug-iphonesimulator/libReact.a /Users/markotomic/Library/Developer/Xcode/DerivedData/NativebaseKitchenSink-elvnsdrsrbdwqtdvdsithdwuzlls/Build/Products/Debug-iphonesimulator/libRCTActionSheet.a /Users/markotomic/Library/Developer/Xcode/DerivedData/NativebaseKitchenSink-elvnsdrsrbdwqtdvdsithdwuzlls/Build/Products/Debug-iphonesimulator/libRCTGeolocation.a /Users/markotomic/Library/Developer/Xcode/DerivedData/NativebaseKitchenSink-elvnsdrsrbdwqtdvdsithdwuzlls/Build/Products/Debug-iphonesimulator/libRCTImage.a /Users/markotomic/Library/Developer/Xcode/DerivedData/NativebaseKitchenSink-elvnsdrsrbdwqtdvdsithdwuzlls/Build/Products/Debug-iphonesimulator/libRCTLinking.a /Users/markotomic/Library/Developer/Xcode/DerivedData/NativebaseKitchenSink-elvnsdrsrbdwqtdvdsithdwuzlls/Build/Products/Debug-iphonesimulator/libRCTNetwork.a /Users/markotomic/Library/Developer/Xcode/DerivedData/NativebaseKitchenSink-elvnsdrsrbdwqtdvdsithdwuzlls/Build/Products/Debug-iphonesimulator/libRCTSettings.a /Users/markotomic/Library/Developer/Xcode/DerivedData/NativebaseKitchenSink-elvnsdrsrbdwqtdvdsithdwuzlls/Build/Products/Debug-iphonesimulator/libRCTText.a /Users/markotomic/Library/Developer/Xcode/DerivedData/NativebaseKitchenSink-elvnsdrsrbdwqtdvdsithdwuzlls/Build/Products/Debug-iphonesimulator/libRCTVibration.a /Users/markotomic/Library/Developer/Xcode/DerivedData/NativebaseKitchenSink-elvnsdrsrbdwqtdvdsithdwuzlls/Build/Products/Debug-iphonesimulator/libRCTWebSocket.a -lCodePush -lz -lCore -Xlinker -dependency_info -Xlinker /Users/markotomic/Library/Developer/Xcode/DerivedData/NativebaseKitchenSink-elvnsdrsrbdwqtdvdsithdwuzlls/Build/Intermediates/NativebaseKitchenSink.build/Debug-iphonesimulator/NativebaseKitchenSink.build/Objects-normal/x86_64/NativebaseKitchenSink_dependency_info.dat -o /Users/markotomic/Library/Developer/Xcode/DerivedData/NativebaseKitchenSink-elvnsdrsrbdwqtdvdsithdwuzlls/Build/Products/Debug-iphonesimulator/NativebaseKitchenSink.app/NativebaseKitchenSink
ld: framework not found AWSCore for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.