diff --git a/LoopFollow/Remote/TRC/PushMessage.swift b/LoopFollow/Remote/TRC/PushMessage.swift index 09ea4e817..7c4deb73c 100644 --- a/LoopFollow/Remote/TRC/PushMessage.swift +++ b/LoopFollow/Remote/TRC/PushMessage.swift @@ -7,20 +7,16 @@ struct EncryptedPushMessage: Encodable { let aps: APSPayload let encryptedData: String - init(encryptedData: String, commandType: TRCCommandType) { + init(encryptedData: String, commandType _: TRCCommandType) { self.encryptedData = encryptedData - aps = APSPayload(alert: "Remote Command: \(commandType.displayName)") + aps = APSPayload() } struct APSPayload: Encodable { let contentAvailable: Int = 1 - let interruptionLevel: String = "time-sensitive" - let alert: String enum CodingKeys: String, CodingKey { case contentAvailable = "content-available" - case interruptionLevel = "interruption-level" - case alert } } diff --git a/LoopFollow/Remote/TRC/PushNotificationManager.swift b/LoopFollow/Remote/TRC/PushNotificationManager.swift index 1cef2ff1a..88924748b 100644 --- a/LoopFollow/Remote/TRC/PushNotificationManager.swift +++ b/LoopFollow/Remote/TRC/PushNotificationManager.swift @@ -258,10 +258,10 @@ class PushNotificationManager { request.httpMethod = "POST" request.setValue("bearer \(jwt)", forHTTPHeaderField: "authorization") request.setValue("application/json", forHTTPHeaderField: "content-type") - request.setValue("10", forHTTPHeaderField: "apns-priority") + request.setValue("5", forHTTPHeaderField: "apns-priority") request.setValue("600", forHTTPHeaderField: "apns-expiration") request.setValue(bundleId, forHTTPHeaderField: "apns-topic") - request.setValue("alert", forHTTPHeaderField: "apns-push-type") + request.setValue("background", forHTTPHeaderField: "apns-push-type") request.setValue(payload.commandType.rawValue, forHTTPHeaderField: "apns-collapse-id") request.httpBody = try JSONEncoder().encode(finalMessage)