Skip to content

Commit

Permalink
Updates from Wed 25 Mar
Browse files Browse the repository at this point in the history
- [ReactNative] Add deep linking api | Tadeu Zagallo
- [ReactNative] Add gitignore example for SampleApp | Alex Kotliarskyi
- [ReactNative] Add react-native-start bin to react-native packge | Alex Kotliarskyi
- [ReactNative] Update package.json to be npm-ready | Christopher Chedeau
  • Loading branch information
vjeux committed Mar 26, 2015
1 parent 41453a5 commit beb38a8
Show file tree
Hide file tree
Showing 24 changed files with 691 additions and 124 deletions.
6 changes: 3 additions & 3 deletions Examples/2048/2048/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ @implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSURL *jsCodeLocation;
RCTRootView *rootView = [[RCTRootView alloc] init];

// Loading JavaScript code - uncomment the one you want.

Expand All @@ -37,8 +36,9 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
// and uncomment the next following line
// jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];

rootView.scriptURL = jsCodeLocation;
rootView.moduleName = @"Game2048";
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"Game2048"
launchOptions:launchOptions];

self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [[UIViewController alloc] init];
Expand Down
42 changes: 34 additions & 8 deletions Examples/Movies/Movies.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
140D9B661AC36C42004F25EE /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14312D241AC3654D00CDC950 /* libRCTLinking.a */; };
58C5726B1AA6239E00CDF9C8 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58C5725B1AA6236500CDF9C8 /* libRCTText.a */; };
58C5726C1AA623A200CDF9C8 /* libReactKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58C572681AA6236600CDF9C8 /* libReactKit.a */; };
/* End PBXBuildFile section */
Expand All @@ -32,6 +33,13 @@
remoteGlobalIDString = 58B5115D1A9E6B3D00147676;
remoteInfo = RCTImage;
};
14312D231AC3654D00CDC950 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 14312D1E1AC3654D00CDC950 /* RCTLinking.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 134814201AA4EA6300B7C361;
remoteInfo = RCTLinking;
};
58C5725A1AA6236500CDF9C8 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 587650F61A9EB120008B8F17 /* RCTText.xcodeproj */;
Expand All @@ -58,6 +66,7 @@
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = Movies/Images.xcassets; sourceTree = "<group>"; };
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Movies/Info.plist; sourceTree = "<group>"; };
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Movies/main.m; sourceTree = "<group>"; };
14312D1E1AC3654D00CDC950 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = ../../Libraries/LinkingIOS/RCTLinking.xcodeproj; sourceTree = "<group>"; };
587650F61A9EB120008B8F17 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = ../../Libraries/Text/RCTText.xcodeproj; sourceTree = SOURCE_ROOT; };
587650F91A9EB120008B8F17 /* ReactKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ReactKit.xcodeproj; path = ../../ReactKit/ReactKit.xcodeproj; sourceTree = SOURCE_ROOT; };
/* End PBXFileReference section */
Expand All @@ -67,6 +76,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
140D9B661AC36C42004F25EE /* libRCTLinking.a in Frameworks */,
1341801E1AA91750003F314A /* libRCTNetwork.a in Frameworks */,
13442C061AA90EA00037E5B0 /* libRCTImage.a in Frameworks */,
58C5726B1AA6239E00CDF9C8 /* libRCTText.a in Frameworks */,
Expand Down Expand Up @@ -106,9 +116,18 @@
name = Movies;
sourceTree = "<group>";
};
14312D1F1AC3654D00CDC950 /* Products */ = {
isa = PBXGroup;
children = (
14312D241AC3654D00CDC950 /* libRCTLinking.a */,
);
name = Products;
sourceTree = "<group>";
};
58C571FC1AA6124500CDF9C8 /* Libraries */ = {
isa = PBXGroup;
children = (
14312D1E1AC3654D00CDC950 /* RCTLinking.xcodeproj */,
134180151AA91740003F314A /* RCTNetwork.xcodeproj */,
13442C001AA90E7D0037E5B0 /* RCTImage.xcodeproj */,
587650F61A9EB120008B8F17 /* RCTText.xcodeproj */,
Expand Down Expand Up @@ -195,6 +214,10 @@
ProductGroup = 13442C011AA90E7D0037E5B0 /* Products */;
ProjectRef = 13442C001AA90E7D0037E5B0 /* RCTImage.xcodeproj */;
},
{
ProductGroup = 14312D1F1AC3654D00CDC950 /* Products */;
ProjectRef = 14312D1E1AC3654D00CDC950 /* RCTLinking.xcodeproj */;
},
{
ProductGroup = 134180161AA91740003F314A /* Products */;
ProjectRef = 134180151AA91740003F314A /* RCTNetwork.xcodeproj */;
Expand Down Expand Up @@ -230,6 +253,13 @@
remoteRef = 13442C041AA90E7D0037E5B0 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
14312D241AC3654D00CDC950 /* libRCTLinking.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libRCTLinking.a;
remoteRef = 14312D231AC3654D00CDC950 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
58C5725B1AA6236500CDF9C8 /* libRCTText.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
Expand Down Expand Up @@ -294,12 +324,10 @@
);
INFOPLIST_FILE = "$(SRCROOT)/Movies/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"/Users/nicklockwood/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/Libraries/Network/build/Debug-iphoneos",
);
LIBRARY_SEARCH_PATHS = "$(inherited)";
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = Movies;
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../Libraries/**";
};
name = Debug;
};
Expand All @@ -314,12 +342,10 @@
);
INFOPLIST_FILE = "$(SRCROOT)/Movies/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"/Users/nicklockwood/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/Libraries/Network/build/Debug-iphoneos",
);
LIBRARY_SEARCH_PATHS = "$(inherited)";
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = Movies;
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../../Libraries/**";
};
name = Release;
};
Expand Down
18 changes: 15 additions & 3 deletions Examples/Movies/Movies/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@

#import "AppDelegate.h"

#import "RCTLinkingManager.h"
#import "RCTRootView.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSURL *jsCodeLocation;
RCTRootView *rootView = [[RCTRootView alloc] init];

// Loading JavaScript code - uncomment the one you want.

Expand All @@ -37,8 +37,9 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
// and uncomment the next following line
// jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];

rootView.scriptURL = jsCodeLocation;
rootView.moduleName = @"MoviesApp";
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"MoviesApp"
launchOptions:launchOptions];

self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [[UIViewController alloc] init];
Expand All @@ -48,4 +49,15 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
return YES;
}

- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation
{
return [RCTLinkingManager application:application
openURL:url
sourceApplication:sourceApplication
annotation:annotation];
}

@end
15 changes: 13 additions & 2 deletions Examples/Movies/Movies/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>movies</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
Expand All @@ -28,13 +39,13 @@
<array>
<string>armv7</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
2 changes: 2 additions & 0 deletions Examples/Movies/SearchScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ var TimerMixin = require('react-timer-mixin');
var MovieCell = require('./MovieCell');
var MovieScreen = require('./MovieScreen');

var fetch = require('fetch');

var API_URL = 'http://api.rottentomatoes.com/api/public/v1.0/';
var API_KEYS = ['7waqfqbprs7pajbz28mqf6vz', 'y4vwv8m33hed9ety83jmv52f'];

Expand Down
27 changes: 27 additions & 0 deletions Examples/SampleApp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# OSX
#
.DS_Store

# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate

# node.js
#
node_modules/
npm-debug.log
6 changes: 3 additions & 3 deletions Examples/SampleApp/iOS/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ @implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSURL *jsCodeLocation;
RCTRootView *rootView = [[RCTRootView alloc] init];

// Loading JavaScript code - uncomment the one you want.

Expand All @@ -37,8 +36,9 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
// and uncomment the next following line
// jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];

rootView.scriptURL = jsCodeLocation;
rootView.moduleName = @"SampleApp";
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"SampleApp"
launchOptions:launchOptions];

self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [[UIViewController alloc] init];
Expand Down
6 changes: 3 additions & 3 deletions Examples/TicTacToe/TicTacToe/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ @implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSURL *jsCodeLocation;
RCTRootView *rootView = [[RCTRootView alloc] init];

// Loading JavaScript code - uncomment the one you want.

Expand All @@ -37,8 +36,9 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
// and uncomment the next following line
// jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];

rootView.scriptURL = jsCodeLocation;
rootView.moduleName = @"TicTacToeApp";
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"TicTacToeApp"
launchOptions:launchOptions];

self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [[UIViewController alloc] init];
Expand Down
6 changes: 3 additions & 3 deletions Examples/UIExplorer/UIExplorer/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ @implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSURL *jsCodeLocation;
RCTRootView *rootView = [[RCTRootView alloc] init];

// Loading JavaScript code - uncomment the one you want.

Expand All @@ -37,8 +36,9 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
// and uncomment the next following line
// jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];

rootView.scriptURL = jsCodeLocation;
rootView.moduleName = @"UIExplorerApp";
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"UIExplorerApp"
launchOptions:launchOptions];

self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [[UIViewController alloc] init];
Expand Down
6 changes: 3 additions & 3 deletions IntegrationTests/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ @implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSURL *jsCodeLocation;
RCTRootView *rootView = [[RCTRootView alloc] init];

// Loading JavaScript code - uncomment the one you want.

Expand All @@ -37,8 +36,9 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
// and uncomment the next following line
// jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];

rootView.scriptURL = jsCodeLocation;
rootView.moduleName = @"IntegrationTestsApp";
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"IntegrationTestsApp"
launchOptions:launchOptions];

self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [[UIViewController alloc] init];
Expand Down
Loading

0 comments on commit beb38a8

Please sign in to comment.