             completionHandler(UIBackgroundFetchResult.newData)
         })
         
-        // Unwrap startup notification
-        if let notification = self.startupNotification {
-            // Check for non-empty dictionary
-            if notification.count > 0 {
-                // Execute notification handler (pass in startup notification payload)
-                getPushyInstance().getNotificationHandler()?(notification, {(UIBackgroundFetchResult) in})
-            }
+        // Check for startup notification if set
+        if self.hasStartupNotification {
+            // Execute notification handler (pass in startup notification payload)
+            getPushyInstance().getNotificationHandler()?(self.startupNotification!, {(UIBackgroundFetchResult) in})
         }
     }
     


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

            
            // 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)
