fixes races bug in react-native > 0.52

This commit is contained in:
Taxidermic 2018-04-04 14:05:32 +03:00
parent 90d35ef6e9
commit 9c4deb541a
1 changed files with 2 additions and 1 deletions

View File

@ -5,6 +5,7 @@
#import <FirebaseAnalytics/FIRAnalyticsConfiguration.h>
@implementation RNFirebaseAnalytics
@synthesize methodQueue = _methodQueue;
RCT_EXPORT_MODULE();
RCT_EXPORT_METHOD(logEvent:(NSString *)name props:(NSDictionary *)props) {
@ -16,7 +17,7 @@ RCT_EXPORT_METHOD(setAnalyticsCollectionEnabled:(BOOL) enabled) {
}
RCT_EXPORT_METHOD(setCurrentScreen:(NSString *) screenName screenClass:(NSString *) screenClassOverriew) {
dispatch_async(dispatch_get_main_queue(), ^{
dispatch_sync(dispatch_get_main_queue(), ^{
[FIRAnalytics setScreenName:screenName screenClass:screenClassOverriew];
});
}