     
     func didRegisterForRemoteNotifications(deviceToken: Data) {
         
+        CDVBMSPush.sharedInstance.shouldRegister = true;
+        CDVBMSPush.sharedInstance.bmsPushToken = deviceToken;
         if (CDVBMSPush.sharedInstance.registerCallbackId == nil) {
             return
         }
-        CDVBMSPush.bmsPushToken = deviceToken;
-        registerDeviceAfterTokenRecieve(CDVBMSPush.registerParams)
+        registerDeviceAfterTokenRecieve(CDVBMSPush.sharedInstance.registerParams)
     }
     
     func didFailToRegisterForRemoteNotifications(error: Error) {

    }
    
    func didRegisterForRemoteNotifications(deviceToken: NSData) {
        
        if (CDVBMSPush.sharedInstance.registerCallbackId == nil) {
            return
        }
        CDVBMSPush.bmsPushToken = deviceToken;
        registerDeviceAfterTokenRecieve(CDVBMSPush.registerParams)
    }
    
    func didFailToRegisterForRemoteNotifications(error: NSError) {

        
        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 {
            
