Having issue with defining a native module from the tutorial in https://facebook.github.io/react-native/docs/native-modules-ios.html.
#import "CalendarManager.h"
#import <React/RCTLog.h>
@implementation CalendarManager
RCT_EXPORT_MODULE();
RCT_EXPORT_METHOD(addEvent: (NSString *)name location: (NSString *)location)
{
}
@end
It give me the compile error in RCT_EXPORT_METHOD saying
"Expected ')'"
. and
'Type specifier missing, defaults to int' (later also appeared under RCT_EXPORT_MODULE)
You need to insert #import <React/RCTBridgeModule.h>
in CalendarManager.h either.
Like this
#import <Foundation/Foundation.h>
#import <React/RCTBridgeModule.h>
NS_ASSUME_NONNULL_BEGIN
@interface CalendarManager : NSObject<RCTBridgeModule>
@end
NS_ASSUME_NONNULL_END
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With