Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(aws-amplify-react-native): Federated Signin for react-native with Google and Facebook providers #878

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f12464b
Changing dependency on typescript to fix security issue
Jan 5, 2018
261c8e0
merging master with push
Feb 27, 2018
37fc8df
federated signin bug fix
Mar 12, 2018
94a7b8c
Merge remote-tracking branch 'upstream/master' into updateversion
Mar 12, 2018
4dc43d3
Adding domain for developer type provider
Mar 12, 2018
36340e7
Merge branch 'master' into updateversion
mlabieniec Mar 12, 2018
a3cb190
Merge remote-tracking branch 'upstream/master' into updateversion
Mar 15, 2018
6f99500
temporary commit
Mar 15, 2018
74103af
GoogleSignIn
Mar 29, 2018
ce20ce9
merging with upstream
Mar 29, 2018
3add58a
Merge branch 'updateversion' of https://github.com/nidsharm/aws-ampli…
Mar 29, 2018
0025088
readme for google signin ios instructions
Mar 29, 2018
15dda90
instructions for Android added too
Mar 29, 2018
d70801b
Adding Auth.ts back
Mar 30, 2018
1367a56
Updating Auth.ts
Mar 30, 2018
5ca15f1
new googlesignin file
Mar 30, 2018
f9b5bdb
renaming google signin file
Mar 30, 2018
efc0beb
Google Signin package
Apr 24, 2018
cae2c1d
updating the npm install package list
Apr 24, 2018
f0c8715
removing package-lock.json files
Apr 25, 2018
9713a35
merging with upstream/master
Apr 26, 2018
a6923c0
adding screenshots in google signin instructions
Apr 26, 2018
3e5a86a
updated Readme
Apr 26, 2018
4dfc99a
Adding ios support
Apr 27, 2018
1eafc5e
ios
Apr 27, 2018
8fbdd62
ios 2
Apr 27, 2018
3df2364
version change
Apr 27, 2018
139fe7a
Federated rn signin
May 17, 2018
66763c5
pods
May 18, 2018
18edaf1
merging upstream
May 18, 2018
f92761b
Merge remote-tracking branch 'upstream/master' into updateversion
May 18, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/media/images/xcode-adding-url-types.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 78 additions & 0 deletions docs/media/react_native_google_signin_stup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#Google Sign-In for React Native

##Installation for iOS

1. react-native init myApp

2. npm install --save aws-amplify
3. npm install --save aws-amplify-react-native
4. npm install --save react-native-aws-amplify-google-signin
5. react-native link react-native-aws-amplify-google-signin
6. Install the required SDKs using CocoaPods :
```
cd ios
pod init
vi Podfile
```

7. Add the following pods for target myApp:
```
pod 'GoogleSignIn'
pod 'GoogleAppUtilities'
pod 'GoogleAuthUtilities'
pod 'GoogleNetworkingUtilities'
pod 'GoogleSymbolUtilities'
pod 'GoogleUtilities'
```
8. Save changes to your Podfile, and run:
```
pod install
```
9. Now open your project in xcode using myApp.xcworkspace
10. Add a new URL with the Identifier and URL schemes set to your app's REVERSED_CLIENT_ID(found inside GoogleService-Info.plist file), like so:

<img src="{%if jekyll.environment == 'production'%}{{site.amplify.baseurl}}{%endif%}/media/images/xcode-adding-url-types.png" width="100%"/>


Note: If you already have your app configured on Google Developer console, then just download the plist file for your OAuth Client. If you haven't set up your Client IDs for your app, follow : https://developers.google.com/identity/sign-in/ios/sdk/ to get your app setup with a web client, iOS client and Android client.


Now execute react-native run-ios to log into your App with Google Signin!


---------------------------------------------
Android set up :

1. npm install --save aws-amplify
2. npm install --save aws-amplify-react-native
3. react-native link aws-amplify-react-native
4. Add your app's google-services.json file to android/app folder.
5. Run react-native run-android from the command prompt.







6. In your App.js add the following imports and configure Amplify:
```
import Amplify from 'aws-amplify';
import {withAuthenticator} from 'aws-amplify-react-native';
import {awsmobile} from './aws-exports';
Amplify.configure(awsmobile);
```

7. Wrap your app inside the withAuthenticator HOC:
```
const AppWithAuth = withAuthenticator(App);

const federated = {
google_ios_client_id: '886205636996-fhprhdm8auutm34ssstbjdkq59bit3ek.apps.googleusercontent.com',
google_web_client_id: '886205636996-rai4kpc3g7lg0kd66htrce63q3ub8315.apps.googleusercontent.com'
};
const FederatedApp = () => { return <AppWithAuth federated = {federated}/>}
export default FederatedApp
```


Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading