Merge pull request #413 from akshetpandey/fixUIKitBug
UIApplication methods should only be called from the main thread
This commit is contained in:
commit
614a61eeb7
|
@ -16,7 +16,9 @@ RCT_EXPORT_METHOD(setAnalyticsCollectionEnabled:(BOOL) enabled) {
|
||||||
}
|
}
|
||||||
|
|
||||||
RCT_EXPORT_METHOD(setCurrentScreen:(NSString *) screenName screenClass:(NSString *) screenClassOverriew) {
|
RCT_EXPORT_METHOD(setCurrentScreen:(NSString *) screenName screenClass:(NSString *) screenClassOverriew) {
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
[FIRAnalytics setScreenName:screenName screenClass:screenClassOverriew];
|
[FIRAnalytics setScreenName:screenName screenClass:screenClassOverriew];
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
RCT_EXPORT_METHOD(setUserId: (NSString *) id) {
|
RCT_EXPORT_METHOD(setUserId: (NSString *) id) {
|
||||||
|
|
|
@ -386,8 +386,10 @@ RCT_EXPORT_METHOD(getScheduledLocalNotifications:(RCTPromiseResolveBlock)resolve
|
||||||
}
|
}
|
||||||
|
|
||||||
RCT_EXPORT_METHOD(setBadgeNumber: (NSInteger*) number) {
|
RCT_EXPORT_METHOD(setBadgeNumber: (NSInteger*) number) {
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
[RCTSharedApplication() setApplicationIconBadgeNumber:number];
|
[RCTSharedApplication() setApplicationIconBadgeNumber:number];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RCT_EXPORT_METHOD(getBadgeNumber: (RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
|
RCT_EXPORT_METHOD(getBadgeNumber: (RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) {
|
||||||
resolve(@([RCTSharedApplication() applicationIconBadgeNumber]));
|
resolve(@([RCTSharedApplication() applicationIconBadgeNumber]));
|
||||||
|
|
Loading…
Reference in New Issue