-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
Hi,
I have one custom cordova plugin made by client developers, which i need to be integrated into my react-native application for IOS.
I have used your component and also added the cordova class in my project, but i get the above mentioned error i.e. No visible @interface for 'CDVPluginResult' declares the selector 'setKeepCallbackAsBool:'
Following is the code of cordova class .m file:
#import "CordovaHaxeBridge.h"
#import "mmsne_api.h"
NSString * callbackId;
CordovaHaxeBridge * instance;
void on_event(NSString * name, NSString * data) {
//NSLog(@"Event %@ : %@",name,data);
if (instance && callbackId)
@autoreleasepool {
NSDictionary * evt = [NSDictionary dictionaryWithObjectsAndKeys:name,@"name",data,@"data", nil];
CDVPluginResult *result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
messageAsDictionary:evt];
[result setKeepCallbackAsBool:YES];
[instance.commandDelegate sendPluginResult:result callbackId: callbackId];
}
else
NSLog(@"EVENT NOT PASSED ON: %@",name);
//delete name, data;
}
@implementation CordovaHaxeBridge {}
RCT_EXPORT_MODULE(RCTCordovaHaxeBridge)
RCT_EXPORT_CORDOVA_METHOD(call);
- (void)pluginInitialize {
NSLog(@"Initing MMSNE Cordova plugin");
init_mms(&on_event);
instance = self;
}
- (void)eventer:(CDVInvokedUrlCommand *)command {
NSLog(@"Eventer initialized");
callbackId = command.callbackId;
}
- (void)call:(CDVInvokedUrlCommand *)command {
NSString * fname = [command.arguments objectAtIndex: 0];
NSString * args = [command.arguments objectAtIndex: 1];
//NSLog(@"OC PRE Call %@: %@",fname,args);
call_haxe(fname,args);
//NSLog(@"OC POST Call %@",fname);
//delete fname, args;
CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}
@end
I am getting error on the following line:
[result setKeepCallbackAsBool:YES];
Following is the code of .h file :
#import "CDVPlugin.h"
@interface CordovaHaxeBridge : CDVPlugin
- (void)call:(CDVInvokedUrlCommand*)command;
- (void)eventer:(CDVInvokedUrlCommand*)command;
@end
I have compared the code from the following url:
https://github.com/apache/cordova-ios/blob/master/CordovaLib/Classes/Public/CDVPluginResult.m
there are some functions which are not included in your class can you please explain the reason for same.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels