/********* DDPlugin.m Cordova Plugin Implementation *******/

#import <Cordova/CDV.h>
#import<DIOpenSDK/DIOpenSDK.h>
@interface DDPlugin : CDVPlugin<DIOpenSDKDelegate> {
  // Member variables go here.
}

- (void)openDiDi:(CDVInvokedUrlCommand*)command;
@end

@implementation DDPlugin
- (void)pluginInitialize {
   [DIOpenSDK registerApp:@"didi6358574A5079702B68447976547377" secret:@"f14aed32707f69ae23e7858c1fd29e4e"];
}

- (void)openDiDi:(CDVInvokedUrlCommand*)command
{

    //注册option
    DIOpenSDKRegisterOptions * diOption = [[DIOpenSDKRegisterOptions alloc]init];
    //打开界面
    [DIOpenSDK showDDPage:self.viewController animated:true params:diOption delegate:self.viewController];

}

@end
