Hello friends i want to make my plugin in react native and i want to call my ios native module function from my react native js file so below is my code
ios library code as below
@implementation RNMyLib
- (dispatch_queue_t)methodQueue{
return dispatch_get_main_queue();
}
RCT_EXPORT_MODULE()
RCT_EXPORT_METHOD(findEvents:(RCTResponseSenderBlock)callback)
{
NSString * strName = @"findEvents";
callback(strName);
}
JS file code as below
import { NativeModules } from 'react-native';
var MyLibManager = NativeModules.RNMyLib;
MyLibManager.findEvents((strName) => {
console.log("GET FUN CODE >>>>> "+ strName);
});
i want to just call simple function from my js file to ios native library class but when i run above code i get error like TypeError: undefined is not an object (evaluating 'MyLibManager.findEvents')
any idea how can i solve this ? your all suggestions are applicable