diff --git a/Sources/VaporAPNS/VaporAPNS.swift b/Sources/VaporAPNS/VaporAPNS.swift index be4cd20..83b87e7 100644 --- a/Sources/VaporAPNS/VaporAPNS.swift +++ b/Sources/VaporAPNS/VaporAPNS.swift @@ -59,7 +59,7 @@ open class VaporAPNS { let headers = self.requestHeaders(for: message) var curlHeaders: UnsafeMutablePointer? if !options.usesCertificateAuthentication { - let currentTime = Date().timeIntervalSince1970 + let currentTime = Int(Date().timeIntervalSince1970.rounded()) let jsonPayload = try! JSON(node: [ "iss": options.teamId, "iat": currentTime diff --git a/Tests/VaporAPNSTests/VaporAPNSTests.swift b/Tests/VaporAPNSTests/VaporAPNSTests.swift index bfcd8ab..e7c0bf9 100644 --- a/Tests/VaporAPNSTests/VaporAPNSTests.swift +++ b/Tests/VaporAPNSTests/VaporAPNSTests.swift @@ -48,7 +48,7 @@ class VaporAPNSTests: XCTestCase { // TODO: Set this up so others can test this } func testEncoding() throws { - let currentTime = Date().timeIntervalSince1970 + let currentTime = Int(Date().timeIntervalSince1970.rounded()) let jsonPayload = try JSON(node: [ "iss": "D86BEC0E8B", "iat": currentTime