File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -121,16 +121,19 @@ + (void)sendEventWithName:(NSString *)name withBody:(NSDictionary *)body {
121
121
return ;
122
122
}
123
123
124
- NSUInteger types = 0 ;
125
- if ([UIApplication instancesRespondToSelector: @selector (currentUserNotificationSettings )]) {
126
- types = [RCTSharedApplication () currentUserNotificationSettings ].types ;
127
- } else {
124
+ __block NSUInteger types = 0 ;
125
+
126
+ dispatch_sync (dispatch_get_main_queue (), ^{
127
+ if ([UIApplication instancesRespondToSelector: @selector (currentUserNotificationSettings )]) {
128
+ types = [RCTSharedApplication () currentUserNotificationSettings ].types ;
129
+ } else {
128
130
129
131
#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0
130
- types = [RCTSharedApplication () enabledRemoteNotificationTypes ];
132
+ types = [RCTSharedApplication () enabledRemoteNotificationTypes ];
131
133
#endif
132
134
133
- }
135
+ }
136
+ });
134
137
135
138
callback (@[@{
136
139
@" alert" : @((types & UIUserNotificationTypeAlert) > 0 ),
You can’t perform that action at this time.
0 commit comments