How to call a cordova plugin(native iOS) method from another plugin?

Viewed 300

I need to call method of (cordova-plugin-screen-orientation) in iOS class of my custom created cordova-plugin.

I am using cordova plugin (cordova-plugin-screen-orientation) to change orientation of my app.I am creating my custom plugin in which, I need to change my orientation on specific event.

#import "YoikScreenOrientation.h"

-(void)screenOrientation:(CDVInvokedUrlCommand *)command
{      
    //Block of code to change orientation
}

In my custom plugin myfile.m class, import "YoikScreenOrientation.h"

CDVInvokedUrlCommand *obj = [CDVInvokedUrlCommand alloc];
NSArray *myArray = [NSArray arrayWithObjects:@"landscape", nil];
[obj.arguments arrayByAddingObjectsFromArray:myArray];
YoikScreenOrientation *YSO = [YoikScreenOrientation alloc];
[YSO screenOrientation:obj];

I expect command.arguments in screenOrientation method to get value "landscape", but it's getting nil.

0 Answers
Related