bugsnag / bugsnag-react-native

Error monitoring and reporting tool for native exceptions and JS errors in React Native apps
https://docs.bugsnag.com/platforms/react-native
MIT License
370 stars 121 forks source link

ios warning: UI API called on a background thread #396

Closed idanhaviv closed 5 years ago

idanhaviv commented 5 years ago

Description

running on iPhone X ios 12.2 in debug from Xcode logs a Main Thread Checker warning in Xcode logs

Environment

Library versions:

bugsnag-react-native@2.22.6
react-native@0.60.4
kattrali commented 5 years ago

Thanks for the report, @idanhaviv. What was in the log message? As far as I can tell, bugsnag-react-native does not call UI methods.

idanhaviv commented 5 years ago

hey @kattrali, this is a screenshot of Xcode log Untitled

kattrali commented 5 years ago

Ah, I see. This seems to be a side effect of expecting initialization to take place on the main thread. The library should handle and warn you in this case, but to work around it, can you configure [BugsnagReactNative start] in your app delegate?

chipqcl commented 5 years ago

can you configure [BugsnagReactNative start] in your app delegate?

Can you give specific instructions for this?

idanhaviv commented 5 years ago

@kattrali i did but still get the warning message

abigailbramble commented 5 years ago

can you configure [BugsnagReactNative start] in your app delegate?

Can you give specific instructions for this?

@chipqcl @idanhaviv There are instructions available in our documentation here: https://docs.bugsnag.com/platforms/react-native/react-native/enhanced-native-integration/#ios-native-installation. Let us know if you have further questions.

idanhaviv commented 5 years ago

adding the api key in info.plist in addition to [BugsnagReactNative start] solved it. @abigail-bugsnag maybe it's worth adding it to the react-native setup docs

chipqcl commented 5 years ago

There are instructions available in our documentation here

Thanks, that worked.

mattdyoung commented 5 years ago

Fixed in v2.23.2, so the workaround of calling [BugsnagReactNative start] should no longer be necessary, unless you require the enhanced native integration for another reason.