react-native-firebase/ios/RNFirebase
Evan Bacon cca3c13d2d Fixed Deadlock
Running this in a detached expo app can sometimes deadlock from thread issues.
I've replaced `dispatch_sync(dispatch_get_main_queue(), ^{});`  with `RCTUnsafeExecuteOnMainQueueSync(^{});` to fix this.

I only hit the error in the `RNFirebaseStorage.m` but it seems like the `RNFirebaseAnalytics.m` and `RNFirebase.m` modules could also have this same issue.

`RCTUnsafeExecuteOnMainQueueSync` checks to see if the method is being executed on the main thread before trying to sync to the main thread. If you try to sync on the main thread whilst on the main thread, you hit a deadlock.

You can read more about it here: https://stackoverflow.com/questions/12379059/why-is-this-dispatch-sync-call-freezing?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa

The only testing I did was in a seperate detached ExpoKit project. Running this function would cause the crash.
```js
await firebase
      .storage()
      .ref(uploadUri)
      .putFile(uri);
```
2018-06-08 14:44:48 -07:00
..
admob add smartbanner landscape for iOS 2017-12-03 19:15:26 +01:00
analytics Fixed Deadlock 2018-06-08 14:44:48 -07:00
auth [ios] Firebase iOS v5 support 2018-05-16 17:22:47 +01:00
config Remove error log from RNFirebaseRemoteConfig 2018-02-15 19:07:15 +01:00
crash [crash][ios] no longer force a crash on report() 2018-04-13 15:07:21 +01:00
database [ios] Set separate dispatch queues for firestore and database 2018-05-15 10:02:18 +01:00
fabric/crashlytics [crashlytics] Add first version of crashlytics functionality 2017-12-06 17:25:17 +00:00
firestore [ios] Firebase iOS v5 support 2018-05-16 17:22:47 +01:00
functions [ios][functions] finalise implementation 2018-05-06 15:36:03 +01:00
instanceid [fcm] Android instanceid and core fcm support; iOS instance and basic fcm support 2018-02-02 08:40:48 +00:00
invites [invites] Add jsInitialised method to improve getInitialInvitation 2018-03-30 10:07:23 +01:00
links [invites] Add jsInitialised method to improve getInitialInvitation 2018-03-30 10:07:23 +01:00
messaging [ios][messaging] Clear pending messages once sent to JS 2018-05-17 08:27:23 +01:00
notifications [ios][notifications] Fix issue with iOS attachments #939 2018-04-13 15:02:27 +01:00
perf [perf][ios] Fix traceWithName 2017-11-09 15:39:25 +00:00
storage Fixed Deadlock 2018-06-08 14:44:48 -07:00
RNFirebase.h [ios] Fix conditional imports 2017-08-11 16:07:39 +01:00
RNFirebase.m Fixed Deadlock 2018-06-08 14:44:48 -07:00
RNFirebaseEvents.h [links] Tweak links event name 2018-03-22 14:56:15 +00:00
RNFirebaseUtil.h [fcm] Work in progress iOS message support 2018-02-02 12:05:51 +00:00
RNFirebaseUtil.m [fcm] Work in progress iOS message support 2018-02-02 12:05:51 +00:00