Skip to content

Commit 7f1d1dd

Browse files
committed
Added README install instructions
1 parent e2fedfe commit 7f1d1dd

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

README.md

+32
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,18 @@ As we are integrating with react-native, we have a little more setup to integrat
4444

4545
### iOS setup
4646

47+
#### RCTLinkingManager
48+
49+
Since `react-native-oauth` depends upon the `RCTLinkingManager` (from react-native core), we'll need to make sure we link this in our app.
50+
51+
In your app, add the following line to your `HEADER SEARCH PATHS`:
52+
53+
```
54+
$(SRCROOT)/../node_modules/react-native/Libraries/LinkingiOS
55+
```
56+
57+
![](./resources/header-search-paths.png)
58+
4759
#### Automatically with [rnpm](https://github.com/rnpm/rnpm)
4860

4961
To automatically link our `react-native-oauth` client to our application, use the `rnpm` tool. [rnpm](https://github.com/rnpm/rnpm) is a React Native package manager which can help to automate the process of linking package environments.
@@ -90,6 +102,26 @@ We need to add a callback method in our `ios/AppDelegate.m` file and then call o
90102
}
91103
```
92104
105+
In addition, we'll need to set up the handlers within the iOS app. Add the following line somewhere in your `application:didFinishLaunchingWithOptions:` method, like so:
106+
107+
```objectivec
108+
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
109+
{
110+
NSURL *jsCodeLocation;
111+
112+
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
113+
114+
// other existing setup here
115+
116+
// ADD THIS LINE SOMEWHERE IN THIS FUNCTION
117+
[OAuthManager setupOAuthHandler:application];
118+
// ...
119+
120+
[self.window makeKeyAndVisible];
121+
return YES;
122+
}
123+
```
124+
93125
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.
94126

95127
### Adding URL schemes

resources/header-search-paths.png

311 KB
Loading

0 commit comments

Comments
 (0)