Fix issue 87: iOS warning: [setShortcutItems()] UI API called on a background thread #87

This commit is contained in:
Ross Miller 2019-11-14 11:57:48 -08:00
parent a64656ad91
commit 3fe6a9e2ec

View File

@ -126,8 +126,10 @@ RCT_EXPORT_MODULE();
RCT_EXPORT_METHOD(setShortcutItems:(NSArray *) shortcutItems)
{
dispatch_async(dispatch_get_main_queue(), ^{
NSArray *dynamicShortcuts = [self dynamicShortcutItemsForPassedArray:shortcutItems];
[UIApplication sharedApplication].shortcutItems = dynamicShortcuts;
});
}
RCT_EXPORT_METHOD(isSupported:(RCTResponseSenderBlock)callback)