Skip to content

Commit

Permalink
Fix issue 87: iOS warning: [setShortcutItems()] UI API called on a ba…
Browse files Browse the repository at this point in the history
…ckground thread jordanbyron#87
  • Loading branch information
rsml authored and 钟加仁 committed Dec 20, 2019
1 parent 1e98e96 commit f638aa3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions RNQuickAction/RNQuickAction/RNQuickActionManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,10 @@ - (NSArray*)dynamicShortcutItemsForPassedArray:(NSArray*)passedArray {

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)
Expand Down

0 comments on commit f638aa3

Please sign in to comment.