Skip to content

Run on device for iOS? (RN .29) #8850

@natdm

Description

@natdm

Running on a device for iOS on .29 seems to be different than where I was at (.26).

On .29, the AppDelegate.m file is vastly different than it was. there's no comments explaining what to do for dev or production.

Docs say:
Open ios/YourApp/AppDelegate.m
Uncomment the line, jsCodeLocation = [[NSBundle mainBundle] ...

My AppDelegate.m has a jsCodeLocation but not [[NSBundle mainBundle] ...

`#import "AppDelegate.h"

import "RCTBundleURLProvider.h"

import "RCTRootView.h"

@implementation AppDelegate

  • (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
    NSURL *jsCodeLocation;

    [[RCTBundleURLProvider sharedSettings] setDefaults];
    jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];

    RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
    moduleName:@"BidSmart"
    initialProperties:nil
    launchOptions:launchOptions];
    rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];

    self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
    UIViewController *rootViewController = [UIViewController new];
    rootViewController.view = rootView;
    self.window.rootViewController = rootViewController;
    [self.window makeKeyAndVisible];
    return YES;
    }

@end`

When I comment out the jsCodeLocation variable in my AppDelegate.m, I get "Unable to execute JS call: __fbBatchedBridge is undefined" on the app - but it builds successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ran CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions