             
             // Store for later
             self.startupNotification = data
+            self.hasStartupNotification = true
             
             // You must call this completion handler when you finish processing
             // the notification (after fetching background data, if applicable)


@objc(PushyPlugin) class PushyPlugin : CDVPlugin {
    var pushy: Pushy?
    var startupNotification: [AnyHashable : Any]?
    
    func getPushyInstance() -> Pushy {

            completionHandler(UIBackgroundFetchResult.newData)
        })
        
        // Check for startup notification if set
        if self.hasStartupNotification {
            // Execute notification handler (pass in startup notification payload)
            getPushyInstance().getNotificationHandler()?(self.startupNotification!, {(UIBackgroundFetchResult) in})
        }
    }
    
