                 let json = try! Jay.init(formatting: .minified).jsonFromData(try! responseData.makeBytes())
                 
                 if (json.dictionary?.keys.contains("reason"))! {
-                    result = Result.error(apnsId: message.messageId, error: APNSError.init(errorReason: json.dictionary!["reason"]!.string!))
+                    result = Result.error(apnsId: message.messageId, deviceToken: deviceToken, error: APNSError.init(errorReason: json.dictionary!["reason"]!.string!))
                 }else {
-                    result = Result.success(apnsId: message.messageId, serviceStatus: .success)
+                    result = Result.success(apnsId: message.messageId, deviceToken: deviceToken, serviceStatus: .success)
                 }
                 
             }else {
-                result = Result.success(apnsId: message.messageId, serviceStatus: .success)
+                result = Result.success(apnsId: message.messageId, deviceToken: deviceToken, serviceStatus: .success)
             }
             
             // Do some cleanup

                let jwt2 = try JWT(token: tokenString, encoding: Base64URLEncoding())
                let verified = try jwt2.verifySignatureWith(ES256(key: publicKey))
                if !verified {
                    return .error(apnsId: message.messageId, error: .invalidSignature)
                }
            } catch {
//                fatalError("\(error)")
                print ("Couldn't verify token. This is a non-fatal error, we'll try to send the notification anyway.")
            }
            
            curlHeaders = curl_slist_append(curlHeaders, "Authorization: bearer \(tokenString)")

            curl_slist_free_all(curlHeaders!)
            
            // todo: Better unknown error handling?
            return Result.networkError(error: SimpleError.string(message: errorString))
            
        }
    }
    
    open func send(_ message: ApplePushMessage, to deviceTokens: [String], perDeviceResultHandler: ((_ result: Result) -> Void)) {
        for deviceToken in deviceTokens {
            let result = self.send(message, to: deviceToken)
            perDeviceResultHandler(result)
        }
    }
    
