OneSignal / react-native-onesignal

React Native Library for OneSignal Push Notifications Service
Other
1.57k stars 373 forks source link

OneSignal required main queue for some methods #1262

Closed Fl0p closed 3 years ago

Fl0p commented 3 years ago

Description: RCTOneSignalEventEmitter runs all react metods in Queue named: "com.facebook.react.OneSignalQueue" which is not main queue

Environment react-native-onesignal-4.2.0

Steps to Reproduce Issue:

  1. Install the OneSignal SDK using npm into your project
  2. Initialize the SDK in the iOS AppDelegate
  3. start app then close
  4. send push with badge
  5. start app again in debug mode

Anything else: You will get error:

[reports] Main Thread Checker: UI API called on a background thread: -[UIApplication applicationIconBadgeNumber]PID: 777, TID: 278975, Thread name: (none), Queue name: com.facebook.react.OneSignalQueue, QoS: 0Backtrace:4 OneSignal 0x000000010733409c +[OneSignal clearBadgeCount:] + 1885 OneSignal 0x000000010732bacc +[OneSignal init] + 8166 OneSignal 0x000000010732b13c +[OneSignal setAppId:] + 2927 ReactApp 0x0000000104f56a98 -[RCTOneSignalEventEmitter setAppId:] + 76

emawby commented 3 years ago

@Fl0p Thank you for the report I am working on a fix (it will be fixed in the iOS Native SDK which will need to be released before the react-native SDK release)