                     }
                 }
             } else{
-                BMSPushClient.sharedInstance.registerWithDeviceToken(deviceToken: CDVBMSPush.bmsPushToken, WithUserId: CDVBMSPush.pushUserId) { (response, statusCode, error) -> Void in
+                BMSPushClient.sharedInstance.registerWithDeviceToken(deviceToken: CDVBMSPush.sharedInstance.bmsPushToken, WithUserId: CDVBMSPush.sharedInstance.pushUserId) { (response, statusCode, error) -> Void in
                     
                     if (!error.isEmpty) {
                         let message = error.description

        
        CDVBMSPush.sharedInstance.registerCallbackId = command.callbackId
        CDVBMSPush.sharedInstance.registerCommandDelegate = self.commandDelegate
        CDVBMSPush.shouldRegister = true;
        CDVBMSPush.registerParams = command
    }
    
    func registerDeviceAfterTokenRecieve(command: CDVInvokedUrlCommand){
        
        guard let settings = command.arguments[0] as? NSDictionary else {
            
            let message = "Registering for Push Notifications failed. Options parameter is Invalid."

        
        CDVBMSPush.sharedInstance.registerCallbackId = command.callbackId
        CDVBMSPush.sharedInstance.registerCommandDelegate = self.commandDelegate
       CDVBMSPush.sharedInstance.registerParams = command
        if ( CDVBMSPush.sharedInstance.shouldRegister == true &&  CDVBMSPush.sharedInstance.bmsPushToken.isEmpty == false){
            
            registerDeviceAfterTokenRecieve(command)
        }
    }
    func registerDeviceAfterTokenRecieve(_ command: CDVInvokedUrlCommand) {
        
        CDVBMSPush.sharedInstance.registerCallbackId = command.callbackId
        CDVBMSPush.sharedInstance.registerCommandDelegate = self.commandDelegate
        
        guard let settings = command.arguments[0] as? NSDictionary else {
            
