From 439a31b69e8074301a9560c055b7f33f03195029 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Wed, 17 Feb 2021 10:06:14 -0600 Subject: [PATCH] Add Stories bridge methods for iOS Add missing bridge methods for the Stories block. The absence of these threw an error, even though Stories block isn't fully supported for iOS just yet. --- .../react-native-bridge/ios/GutenbergBridgeDelegate.swift | 2 +- .../react-native-bridge/ios/RNReactNativeGutenbergBridge.m | 2 +- .../ios/RNReactNativeGutenbergBridge.swift | 4 ++-- .../ios/GutenbergDemo/GutenbergViewController.swift | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/react-native-bridge/ios/GutenbergBridgeDelegate.swift b/packages/react-native-bridge/ios/GutenbergBridgeDelegate.swift index cf180297aff112..5f05ec115d8a27 100644 --- a/packages/react-native-bridge/ios/GutenbergBridgeDelegate.swift +++ b/packages/react-native-bridge/ios/GutenbergBridgeDelegate.swift @@ -270,5 +270,5 @@ public extension GutenbergBridgeDelegate { func gutenbergDidRequestMediaFilesFailedRetryDialog(_ mediaFiles: [[String: Any]]) { } func gutenbergDidRequestMediaFilesUploadCancelDialog(_ mediaFiles: [[String: Any]]) { } func gutenbergDidRequestMediaFilesSaveCancelDialog(_ mediaFiles: [[String: Any]]) { } - func gutenbergDidRequestMediaFilesBlockReplaceSync() {} + func gutenbergDidRequestMediaFilesBlockReplaceSync(_ mediaFiles: [[String: Any]], clientId: String) {} } diff --git a/packages/react-native-bridge/ios/RNReactNativeGutenbergBridge.m b/packages/react-native-bridge/ios/RNReactNativeGutenbergBridge.m index 0981b73bcbbbf5..5ca99e956dc7fa 100644 --- a/packages/react-native-bridge/ios/RNReactNativeGutenbergBridge.m +++ b/packages/react-native-bridge/ios/RNReactNativeGutenbergBridge.m @@ -31,6 +31,6 @@ @interface RCT_EXTERN_MODULE(RNReactNativeGutenbergBridge, NSObject) RCT_EXTERN_METHOD(setFocalPointPickerTooltipShown:(BOOL)tooltipShown) RCT_EXTERN_METHOD(actionButtonPressed:(NSString *)buttonType) RCT_EXTERN_METHOD(mediaSaveSync) -RCT_EXTERN_METHOD(mediaFilesBlockReplaceSync) +RCT_EXTERN_METHOD(mediaFilesBlockReplaceSync:(NSArray *)mediaFiles clientId:(NSString *)clientId) @end diff --git a/packages/react-native-bridge/ios/RNReactNativeGutenbergBridge.swift b/packages/react-native-bridge/ios/RNReactNativeGutenbergBridge.swift index 927f477fcd8a46..302187d23dbcc5 100644 --- a/packages/react-native-bridge/ios/RNReactNativeGutenbergBridge.swift +++ b/packages/react-native-bridge/ios/RNReactNativeGutenbergBridge.swift @@ -338,10 +338,10 @@ public class RNReactNativeGutenbergBridge: RCTEventEmitter { } @objc - func mediaFilesBlockReplaceSync() { + func mediaFilesBlockReplaceSync(_ mediaFiles: [[String: Any]], clientId: String) { DispatchQueue.main.async { if self.hasObservers { - self.delegate?.gutenbergDidRequestMediaFilesBlockReplaceSync() + self.delegate?.gutenbergDidRequestMediaFilesBlockReplaceSync(mediaFiles, clientId: clientId) } } } diff --git a/packages/react-native-editor/ios/GutenbergDemo/GutenbergViewController.swift b/packages/react-native-editor/ios/GutenbergDemo/GutenbergViewController.swift index fd303fe8b773c5..8bc821846f4162 100644 --- a/packages/react-native-editor/ios/GutenbergDemo/GutenbergViewController.swift +++ b/packages/react-native-editor/ios/GutenbergDemo/GutenbergViewController.swift @@ -233,7 +233,7 @@ extension GutenbergViewController: GutenbergBridgeDelegate { print(#function) } - func gutenbergDidRequestMediaFilesBlockReplaceSync() { + func gutenbergDidRequestMediaFilesBlockReplaceSync(_ mediaFiles: [[String: Any]], clientId: String) { print(#function) }