You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Isolates the OAuth experience to a few simple methods.
32
32
* Atomatically stores the tokens for later retrieval
33
-
* Works with many providers and relatively simple to add a new provider
33
+
* Works with many providers and simple to add a new provider
34
+
* Works on both Android and iOS
34
35
35
36
## Installation
36
37
@@ -76,7 +77,7 @@ Finally, open the created `.xcworkspace` in the `ios/` directory (**NOT THE `.xp
76
77
77
78
### Android setup
78
79
79
-
Coming soon (looking for contributors).
80
+
All we need to do is link `react-native-oauth` to our project and Android should just work.
80
81
81
82
## Handle deep linking loading
82
83
@@ -124,6 +125,12 @@ In addition, we'll need to set up the handlers within the iOS app. Add the follo
124
125
125
126
When our app loads up with a request that is coming back from OAuthManager _and_ matches the url pattern, OAuthManager will take over and handle the rest and storing the credentials for later use.
126
127
128
+
### Android setup
129
+
130
+
After we link `react-native-oauth` to our application, we're ready to go. Android integration is much simpler, thanks to the in-app browser ability for our apps. `react-native-oauth` handles this for you.
131
+
132
+
One note, *all* of the callback urls follow the scheme: `http://localhost/[provider_name]`. Make sure this is set as a configuration for each provider below (documented in the provider setup sections).
133
+
127
134
### Adding URL schemes
128
135
129
136
In order for our app to load through these callbacks, we need to tell our iOS app that we want to load them. In order to do that, we'll have to create some URL schemes to register our app. Some providers require specific schemes (mentioned later).
@@ -180,7 +187,7 @@ The `consumer_key` and `consumer_secret` values are _generally_ provided by the
180
187
181
188
The following list are the providers we've implemented thus far in `react-native-oauth` and the _required_ keys to pass when configuring the provider:
182
189
183
-
#### Twitter
190
+
#### Twitter (iOS/Android)
184
191
185
192
To authenticate against twitter, we need to register a Twitter application. Register your twitter application (or create a new one at [apps.twitter.com](https://apps.twitter.com)).
186
193
@@ -205,7 +212,7 @@ const config = {
205
212
}
206
213
```
207
214
208
-
#### Facebook
215
+
#### Facebook (iOS/Android)
209
216
210
217
To add facebook authentication, we'll need to have a Facebook app. To create one (or use an existing one), navigate to [developers.facebook.com/](https://developers.facebook.com/).
211
218
@@ -238,15 +245,15 @@ const config = {
238
245
}
239
246
```
240
247
241
-
#### Google
248
+
#### Google (iOS/Android)
242
249
243
250
To add Google auth to our application, first we'll need to create a google application. Create or use an existing one by heading to the [developers.google.com/](https://developers.google.com/) page (or the console directly at [https://console.developers.google.com](https://console.developers.google.com)).
244
251
245
252

246
253
247
254
We need to enable the `Identity Toolkit API` API. Click on `Enable API` and add this api to your app. Once it's enabled, we'll need to collect our credentials.
248
255
249
-
Navigate to the `Credentials` tab and create a new credential. Create a web API credential. Take note of the client id and the URL scheme. In addition, make sure to set the bundle ID as the bundle id in our application in Xcode:
256
+
Navigate to the `Credentials` tab and create a new credential. Create a **web API credential**. Take note of the client id and the URL scheme. In addition, make sure to set the bundle ID as the bundle id in our application in Xcode:
250
257
251
258

252
259
@@ -266,8 +273,31 @@ const config = {
266
273
}
267
274
```
268
275
269
-
## Authenticating against our providers
276
+
#### Github (iOS/Android)
277
+
278
+
Adding Github auth to our application is pretty simple as well. We'll need to create a web application on the github apps page, which can be found at [https://github.com/settings/developers](https://github.com/settings/developers). Create one, making sure to add _two_ apps (one for iOS and one for Android) with the callback urls as:
0 commit comments