diff --git a/iOS/Plugins/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin.h b/iOS/Plugins/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin.h index 7c7bcb1e8bb..2dc3293e102 100644 --- a/iOS/Plugins/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin.h +++ b/iOS/Plugins/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin.h @@ -16,10 +16,12 @@ @end -FB_EXTERN_C_BEGIN - +#ifdef __cplusplus +extern "C" { +#endif void FlipperKitUIDebuggerAddPlugin(FlipperClient*); - -FB_EXTERN_C_END +#ifdef __cplusplus +} +#endif #endif diff --git a/iOS/Plugins/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin.mm b/iOS/Plugins/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin.mm index 47e02dfe419..af97c63535c 100644 --- a/iOS/Plugins/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin.mm +++ b/iOS/Plugins/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin.mm @@ -15,8 +15,6 @@ #import #import "Core/UIDContext.h" -#import "PluginSockets.h" -#import "Plugins.h" #import "Descriptors/UIDDescriptorRegister.h" #import "Observer/UIDTreeObserverFactory.h" @@ -62,24 +60,4 @@ - (void)didDisconnect { @end -void FlipperKitUIDebuggerAddPlugin(FlipperClient* client) { - UIDContext* context = [[UIDContext alloc] - initWithApplication:[UIApplication sharedApplication] - descriptorRegister:[UIDDescriptorRegister defaultRegister] - observerFactory:[UIDTreeObserverFactory shared]]; - - FlipperKitUIDebuggerPlugin* plugin = - [[FlipperKitUIDebuggerPlugin alloc] initWithContext:context]; - - for (const auto& p : FlipperUIDebuggerDescriptorRegisterSocket_Plugins()) { - FlipperUIDebuggerDescriptorRegisterSocket_InvokeConfigure(p, context); - } - - [client addPlugin:plugin]; -} - -void FlipperKitUIDebuggerPluginInit(FlipperClient* client) { - FlipperKitUIDebuggerAddPlugin(client); -} - #endif diff --git a/iOS/Plugins/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPluginInit.mm b/iOS/Plugins/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPluginInit.mm new file mode 100644 index 00000000000..c642a11d9f0 --- /dev/null +++ b/iOS/Plugins/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPluginInit.mm @@ -0,0 +1,33 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#if FB_SONARKIT_ENABLED + +#import +#import "FlipperKitUIDebuggerPlugin.h" +#import "UIDContext.h" +#import "UIDDescriptorRegister.h" +#import "UIDTreeObserverFactory.h" + +#ifdef __cplusplus +extern "C" { +#endif +void FlipperKitUIDebuggerAddPlugin(FlipperClient* client) { + UIDContext* context = [[UIDContext alloc] + initWithApplication:[UIApplication sharedApplication] + descriptorRegister:[UIDDescriptorRegister defaultRegister] + observerFactory:[UIDTreeObserverFactory shared]]; + FlipperKitUIDebuggerPlugin* plugin = + [[FlipperKitUIDebuggerPlugin alloc] initWithContext:context]; + + [client addPlugin:plugin]; +} +#ifdef __cplusplus +} +#endif + +#endif