         })
     }
     
+    /*
+    * Unregisters the device with IMFPush Notification Server
+    */
     func unregister(command: CDVInvokedUrlCommand) {
         
         self.commandDelegate!.runInBackground({
+            
             self.push.unregisterDevice({ (response:IMFResponse!, error:NSError!) -> Void in
                 if (error != nil) {
                     let message = error.description

        })
    }
    
    public func didRegisterForRemoteNotifications(deviceToken: NSData) {
        
        push.registerDeviceToken(deviceToken) { (response:IMFResponse!, error:NSError!) -> Void in
            if ((error) != nil) {
                
            }
            else {
                
            }
        }
    }
}
import IMFPush
import UIKit


@objc(CDVMFPPush) class CDVMFPPush : CDVPlugin {
    
    static let sharedInstance = CDVMFPPush()
    
    let push = IMFPushClient.sharedInstance()

    var registerCallbackId: String?
    var registerCommandDelegate: CDVCommandDelegate?
    
    /*
    * Registers the device with APNs
    */
    func register(command: CDVInvokedUrlCommand) {
        
        CDVMFPPush.sharedInstance.registerCallbackId = command.callbackId
        CDVMFPPush.sharedInstance.registerCommandDelegate = self.commandDelegate

        self.commandDelegate!.runInBackground({
            
            guard let settings = command.arguments[0] as? NSDictionary else {
                let message = "Settings Parameter is Invalid."
                let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAsString: message)
