From 3fe6a9e2ec005969bc8526d384171fe0bf957535 Mon Sep 17 00:00:00 2001 From: Ross Miller Date: Thu, 14 Nov 2019 11:57:48 -0800 Subject: [PATCH] Fix issue 87: iOS warning: [setShortcutItems()] UI API called on a background thread #87 --- RNQuickAction/RNQuickAction/RNQuickActionManager.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RNQuickAction/RNQuickAction/RNQuickActionManager.m b/RNQuickAction/RNQuickAction/RNQuickActionManager.m index 2ba0190..8db8cab 100644 --- a/RNQuickAction/RNQuickAction/RNQuickActionManager.m +++ b/RNQuickAction/RNQuickAction/RNQuickActionManager.m @@ -126,8 +126,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)