         })
     }
     
-    public func didRegisterForRemoteNotifications(deviceToken: NSData) {
-        
-        push.registerDeviceToken(deviceToken) { (response:IMFResponse!, error:NSError!) -> Void in
-            if ((error) != nil) {
+    /*
+    * Function called after registered for remote notifications. Registers device token from APNs with IMFPush Server.
+    * Called by sharedInstance
+    * Uses command delegate stored in sharedInstance for callback
+    */
+    func didRegisterForRemoteNotifications(deviceToken: NSData) {
+        
+        CDVMFPPush.sharedInstance.registerCommandDelegate!.runInBackground({
+
+            self.push.registerDeviceToken(deviceToken, completionHandler: { (response:IMFResponse!, error:NSError!) -> Void in
                 
-            }
-            else {
-                
-            }
-        }
+                if (error != nil) {
+                    let message = error.description
+                    let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAsString: message)
+                    // call error callback
+                    CDVMFPPush.sharedInstance.registerCommandDelegate!.sendPluginResult(pluginResult, callbackId:self.registerCallbackId)
+                }
+                else {
+                    let message = response.responseText
+                    let pluginResult = CDVPluginResult(status: CDVCommandStatus_OK, messageAsString: message)
+                    // call success callback
+                    CDVMFPPush.sharedInstance.registerCommandDelegate!.sendPluginResult(pluginResult, callbackId:self.registerCallbackId)
+                }
+            })
+            
+        })
     }
 }
    }
    
    // MAY NEED TO CHANGE
    // JS PASSES ONE TAG AS STRING
    // CREATE ARRAY AND ADD ONE TAG
    // THEN CALL SUBSCRIBE/UNSUBSCRIBE
    
    /*
    * Subscribes to a particular backend mobile application Tag(s)

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)
