Skip to content
This repository was archived by the owner on Dec 7, 2021. It is now read-only.

Commit 0c26fd8

Browse files
committed
Fix demo to work with latest react-native
1 parent c0de0dd commit 0c26fd8

File tree

6 files changed

+12
-8
lines changed

6 files changed

+12
-8
lines changed

ReactNativeSimpleAuth.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; };
1616
00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; };
1717
00E356F31AD99517003FC87E /* ReactNativeSimpleAuthTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* ReactNativeSimpleAuthTests.m */; };
18-
0DC97F4DAB9565E3148F8DE2 /* Pods_ReactNativeSimpleAuth.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DC117FD1CDD84A52E50F3C46 /* Pods_ReactNativeSimpleAuth.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
18+
0DC97F4DAB9565E3148F8DE2 /* Pods_ReactNativeSimpleAuth.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DC117FD1CDD84A52E50F3C46 /* Pods_ReactNativeSimpleAuth.framework */; };
1919
133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; };
2020
139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; };
2121
13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };

ReactNativeSimpleAuthTests/ReactNativeSimpleAuthTests.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ - (void)testRendersWelcomeScreen {
4747
[[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
4848
[[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
4949

50-
redboxError = [[RCTRedBox sharedInstance] currentErrorMessage];
50+
// redboxError = [[RCTRedBox sharedInstance] currentErrorMessage];
5151

5252
foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) {
5353
if ([view respondsToSelector:@selector(attributedText)]) {

iOS/AppDelegate.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
4646
// jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
4747

4848
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
49-
moduleName:@"ReactNativeSimpleAuth"
50-
launchOptions:launchOptions];
49+
moduleName:@"ReactNativeSimpleAuth"
50+
initialProperties:nil
51+
launchOptions:launchOptions];
5152

5253
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
5354
UIViewController *rootViewController = [[UIViewController alloc] init];

iOS/Info.plist

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5+
<key>NSAppTransportSecurity</key>
6+
<dict>
7+
<key>NSAllowsArbitraryLoads</key>
8+
<true/>
9+
</dict>
510
<key>CFBundleDevelopmentRegion</key>
611
<string>en</string>
712
<key>CFBundleExecutable</key>

index.ios.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ let secrets = require('./secrets');
1919
class Profile extends React.Component {
2020

2121
constructor(props) {
22-
props.token = props.info.token;
23-
delete props.info.token;
2422
super(props);
2523
this.state = {
2624
name: this.getName(props.provider),
@@ -64,7 +62,7 @@ class Profile extends React.Component {
6462
case 'tumblr':
6563
return `http://api.tumblr.com/v2/blog/${this.props.info.name}.tumblr.com/avatar/96`;
6664
case 'linkedin-web':
67-
var profileUrl = `https://api.linkedin.com/v1/people/~:(picture-url)?oauth2_access_token=${this.props.token}&format=json`
65+
var profileUrl = `https://api.linkedin.com/v1/people/~:(picture-url)?oauth2_access_token=${this.props.info.token}&format=json`
6866
fetch(profileUrl)
6967
.then(response => response.json())
7068
.then(responseJson => {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"mocha": "^2.2.5",
3030
"mocha-traceur": "^2.1.0",
3131
"proxyquire": "^1.5.0",
32-
"react-native": "<=0.11.4",
32+
"react-native": "^0.17.0",
3333
"sinon": "^1.14.1",
3434
"sinon-chai": "^2.7.0"
3535
}

0 commit comments

Comments
 (0)