                     self.commandDelegate!.send(pluginResult, callbackId:command.callbackId)
                     return
                 }
-                
+
                 guard let bmsNotifOptions  = command.arguments[2] as? NSDictionary else {
                     let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Invalid BMSPush Options.")
                     // call success callback
                     self.commandDelegate!.send(pluginResult, callbackId:command.callbackId)
                     return
                 }
-                
-                
+
+
                 if bmsNotifOptions.count > 0{
-                    
-                    for name in bmsNotifOptions {
-                        print(name.key)
-                       // print(((name.value) as! Dictionary).values)
-                        
+
+
+                    guard let result = bmsNotifOptions.value(forKey:"categories") as? [String:AnyObject] else {
+                        let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Invalid BMSPush Options")
+                        // call success callback
+                        self.commandDelegate!.send(pluginResult, callbackId:command.callbackId)
+                        return
+                    }
+
+
+                    var categoryArray = [BMSPushNotificationActionCategory]()
+
+                    for name in result{
+
                         let identifiers:NSArray = (name.value) as! NSArray
                         var actionArray = [BMSPushNotificationAction]()
                         for identifier in identifiers {
-                            actionArray.append(BMSPushNotificationAction(identifierName: (identifier as? NSDictionary)?.allKeys.first as! String, buttonTitle: (identifier as? NSDictionary)?.allValues.first as! String, isAuthenticationRequired: false, defineActivationMode: UIUserNotificationActivationMode.background))
+
+                            let resul = identifier as? NSDictionary
+                            let identifierName = resul?.value(forKey: "IdentifierName");
+                            let actionName = resul?.value(forKey: "actionName");
+
+                            actionArray.append(BMSPushNotificationAction(identifierName: identifierName as! String, buttonTitle:actionName as! String, isAuthenticationRequired: false, defineActivationMode: UIUserNotificationActivationMode.background))
+
                         }
-                        
-                        let category = BMSPushNotificationActionCategory(identifierName: name.key as! String, buttonActions: actionArray)
-                        
-                        let notifOptions = BMSPushClientOptions(categoryName: [category])
-                        
-                        let push = BMSPushClient.sharedInstance;
-                        
+                        let category = BMSPushNotificationActionCategory(identifierName: name.key , buttonActions: actionArray)
+                        categoryArray.append(category)
+                    }
+
+                    let notifOptions = BMSPushClientOptions();
+                    notifOptions.setInteractiveNotificationCategories(categoryName: categoryArray)
+
+
+                    if(bmsNotifOptions.count == 2){
+                        guard let deviceId = bmsNotifOptions.value(forKey:"devieID") as? String else {
+                            let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Invalid BMSPush Options")
+                            // call success callback
+                            self.commandDelegate!.send(pluginResult, callbackId:command.callbackId)
+                            return
+                        }
+                        notifOptions.setDeviceId(deviceId: deviceId)
+                    }
+
+                    let push = BMSPushClient.sharedInstance;
+
                         push.initializeWithAppGUID(appGUID: appGUID, clientSecret: clientSecret, options: notifOptions);
-                        
+
                         let pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAs: "")
                         // call success callback
                         self.commandDelegate!.send(pluginResult, callbackId:command.callbackId)
-                    }
-                    
+
+
                 }else{
                     let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: "Invalid BMSPush Options")
                     // call success callback
                     self.commandDelegate!.send(pluginResult, callbackId:command.callbackId)
                     return
                 }
-                
-                
+
+
                 //use category to handle objective-c exception
-               
-                
+
+
             }else{
-                
-                
+
+
                 guard let appGUID  = command.arguments[0] as? String else {
                     let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: CustomErrorMessages.invalidGuid)
                     // call success callback

            }
        })
    }
    
    func retrieveAvailableTags(command: CDVInvokedUrlCommand) {
        self.commandDelegate.runInBackground({
            
            BMSPushClient.sharedInstance.retrieveSubscriptionsWithCompletionHandler { (response, statusCode, error) -> Void in
                
                if error.isEmpty {
                    
                    let pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAsArray: response! as [AnyObject])
                    // call success callback
                    self.commandDelegate!.sendPluginResult(pluginResult, callbackId:command.callbackId)
                }
                else{
                    
                    print( "Error during retrieveAvailableTags device \(error) ")
                    let message = error
                    let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAsString: message)

        if (settings.count != 0) {
            CDVBMSPush.sharedInstance.pushUserId = settings["userId"] as! String
        }

        CDVBMSPush.sharedInstance.registerCommandDelegate!.runInBackground({

            if CDVBMSPush.sharedInstance.pushUserId.isEmpty{
                BMSPushClient.sharedInstance.registerWithDeviceToken(CDVBMSPush.sharedInstance.bmsPushToken) { (response, statusCode, error) -> Void in

                    if error.isEmpty {

                        let message = response

                        let pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAsString: message)
                        // call success callback
                        CDVBMSPush.sharedInstance.registerCommandDelegate!.sendPluginResult(pluginResult, callbackId:CDVBMSPush.sharedInstance.registerCallbackId)
                    }
                    else{

                        let message = error
                        let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAsString: message)
                        // call error callback
