Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 896eb36

Browse files
author
Will Anderson
committed
Update appBundleUrl so it can be called with no params
1 parent 97be986 commit 896eb36

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

Examples/HybridMobileDeployCompanion/iOS/AppDelegate.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
3333
* on the same Wi-Fi network.
3434
*/
3535

36-
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle"];
36+
//jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle"];
3737

3838
/**
3939
* OPTION 2
@@ -45,7 +45,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
4545
* see http://facebook.github.io/react-native/docs/runningondevice.html
4646
*/
4747

48-
//jsCodeLocation = [HybridMobileDeploy appBundleUrl:@"HybridMobileDeployCompanion" nativeBundleName:@"main"];
48+
jsCodeLocation = [HybridMobileDeploy appBundleUrl];
4949

5050
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
5151
moduleName:@"HybridMobileDeployCompanion"

HybridMobileDeploy.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
@interface HybridMobileDeploy : NSObject <RCTBridgeModule>
44
+ (NSString *) getBundlePath:(NSString*)bundleName;
55
+ (NSURL *) getNativeBundleURL:(NSString*)bundleName;
6+
+ (NSURL *)appBundleUrl;
67
+ (NSURL *)appBundleUrl:(NSString*)bundleName
78
nativeBundleName:(NSString*)nativeBundleName;
89
@end

HybridMobileDeploy.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ + (NSURL *) getNativeBundleURL:(NSString*)bundleName
2626
return [[NSBundle mainBundle] URLForResource:bundleName withExtension:@"jsbundle"];
2727
}
2828

29+
+ (NSURL *) appBundleUrl
30+
{
31+
return [self appBundleUrl:@"bundle"
32+
nativeBundleName:@"main"];
33+
}
34+
2935
+ (NSURL *) appBundleUrl:(NSString*)bundleName
3036
nativeBundleName:(NSString*)nativeBundleName
3137
{

0 commit comments

Comments
 (0)