Make RCTTVNavigationEventEmitter TurboModule-compatible
Summary: See title. Changelog: [iOS][Added] - Make RCTTVNavigationEventEmitter TurboModule-compatible Reviewed By: shergin Differential Revision: D18142252 fbshipit-source-id: c633a5a0abd9e980346379921b34219228153348
This commit is contained in:
Родитель
7e5de4e241
Коммит
3beb8341fd
|
@ -96,6 +96,9 @@ rn_apple_library(
|
||||||
) + react_module_plugin_providers(
|
) + react_module_plugin_providers(
|
||||||
name = "RedBox",
|
name = "RedBox",
|
||||||
native_class_func = "RCTRedBoxCls",
|
native_class_func = "RCTRedBoxCls",
|
||||||
|
) + react_module_plugin_providers(
|
||||||
|
name = "TVNavigationEventEmitter",
|
||||||
|
native_class_func = "RCTTVNavigationEventEmitterCls",
|
||||||
),
|
),
|
||||||
plugins_header = "FBCoreModulesPlugins.h",
|
plugins_header = "FBCoreModulesPlugins.h",
|
||||||
preprocessor_flags = OBJC_ARC_PREPROCESSOR_FLAGS + get_debug_preprocessor_flags() + rn_extra_build_flags() + [
|
preprocessor_flags = OBJC_ARC_PREPROCESSOR_FLAGS + get_debug_preprocessor_flags() + rn_extra_build_flags() + [
|
||||||
|
|
|
@ -48,6 +48,7 @@ Class RCTPerfMonitorCls(void) __attribute__((used));
|
||||||
Class RCTDevMenuCls(void) __attribute__((used));
|
Class RCTDevMenuCls(void) __attribute__((used));
|
||||||
Class RCTDevSettingsCls(void) __attribute__((used));
|
Class RCTDevSettingsCls(void) __attribute__((used));
|
||||||
Class RCTRedBoxCls(void) __attribute__((used));
|
Class RCTRedBoxCls(void) __attribute__((used));
|
||||||
|
Class RCTTVNavigationEventEmitterCls(void) __attribute__((used));
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,7 @@ Class RCTCoreModulesClassProvider(const char *name) {
|
||||||
{"DevMenu", RCTDevMenuCls},
|
{"DevMenu", RCTDevMenuCls},
|
||||||
{"DevSettings", RCTDevSettingsCls},
|
{"DevSettings", RCTDevSettingsCls},
|
||||||
{"RedBox", RCTRedBoxCls},
|
{"RedBox", RCTRedBoxCls},
|
||||||
|
{"TVNavigationEventEmitter", RCTTVNavigationEventEmitterCls},
|
||||||
};
|
};
|
||||||
|
|
||||||
auto p = sCoreModuleClassMap.find(name);
|
auto p = sCoreModuleClassMap.find(name);
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "RCTEventEmitter.h"
|
#import <React/RCTEventEmitter.h>
|
||||||
|
|
||||||
RCT_EXTERN NSString *const RCTTVNavigationEventNotification;
|
RCT_EXTERN NSString *const RCTTVNavigationEventNotification;
|
||||||
|
|
|
@ -7,10 +7,16 @@
|
||||||
|
|
||||||
#import "RCTTVNavigationEventEmitter.h"
|
#import "RCTTVNavigationEventEmitter.h"
|
||||||
|
|
||||||
|
#import <FBReactNativeSpec/FBReactNativeSpec.h>
|
||||||
|
#import "CoreModulesPlugins.h"
|
||||||
|
|
||||||
NSString *const RCTTVNavigationEventNotification = @"RCTTVNavigationEventNotification";
|
NSString *const RCTTVNavigationEventNotification = @"RCTTVNavigationEventNotification";
|
||||||
|
|
||||||
static NSString *const TVNavigationEventName = @"onHWKeyEvent";
|
static NSString *const TVNavigationEventName = @"onHWKeyEvent";
|
||||||
|
|
||||||
|
@interface RCTTVNavigationEventEmitter() <NativeTVNavigationEventEmitterSpec>
|
||||||
|
@end
|
||||||
|
|
||||||
@implementation RCTTVNavigationEventEmitter
|
@implementation RCTTVNavigationEventEmitter
|
||||||
|
|
||||||
RCT_EXPORT_MODULE()
|
RCT_EXPORT_MODULE()
|
||||||
|
@ -44,4 +50,13 @@ RCT_EXPORT_MODULE()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModuleWithJsInvoker:(std::shared_ptr<facebook::react::CallInvoker>)jsInvoker
|
||||||
|
{
|
||||||
|
return std::make_shared<facebook::react::NativeTVNavigationEventEmitterSpecJSI>(self, jsInvoker);
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
Class RCTTVNavigationEventEmitterCls(void) {
|
||||||
|
return RCTTVNavigationEventEmitter.class;
|
||||||
|
}
|
Загрузка…
Ссылка в новой задаче