Pankaj Bhardwaj
Pankaj Bhardwaj

Reputation: 2131

React Native code on launch crashing application

I am getting below message when crashing.

RCTTVNavigationEventEmitter requires main queue setup since it overrides init but doesn't implement requiresMainQueueSetup. In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of.

Code :

NSString *bearerToken = REQUESTS.oAuthRequest.accessToken;
NSURL *jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"home.ios" fallbackResource:nil];

RCTBridge *bridge = [[RCTBridge alloc] initWithBundleURL:jsCodeLocation moduleProvider:nil launchOptions:nil];
NSDictionary *props = @{@"bearer_token" : bearerToken, @"area_id":SELECTED_AREA_ID};
rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"Order" initialProperties:props];
rootView.frame = CGRectMake(0, 64, SCREEN_WIDTH, SCREEN_HEIGHT - 112);
[self.view addSubview:rootView];

Upvotes: 0

Views: 373

Answers (1)

Pankaj Bhardwaj
Pankaj Bhardwaj

Reputation: 2131

There is a nil I found in the props due to that I was getting this error.

NSDictionary *props = @{@"bearer_token" : bearerToken ? bearerToken : @"bearer_token", @"area_id":SELECTED_AREA_ID};

Upvotes: 1

Related Questions