Fix TRC bolus command not received by Trio#589
Open
rafaeldelrey wants to merge 1 commit intoloopandlearn:devfrom
Open
Fix TRC bolus command not received by Trio#589rafaeldelrey wants to merge 1 commit intoloopandlearn:devfrom
rafaeldelrey wants to merge 1 commit intoloopandlearn:devfrom
Conversation
Switch TRC push notifications from alert to background type. Alert-type pushes are silently dropped by iOS when Trio has not been granted notification permissions. Background push with content-available: 1 and priority 5 is delivered regardless, which is the correct mechanism for remote command delivery.
rafaeldelrey
commented
Apr 5, 2026
| init(encryptedData: String, commandType _: TRCCommandType) { | ||
| self.encryptedData = encryptedData | ||
| aps = APSPayload(alert: "Remote Command: \(commandType.displayName)") | ||
| aps = APSPayload() |
Author
There was a problem hiding this comment.
This article says background notifications should not contain alert: developer.apple.com/documentation/usernotifications/pushing-background-updates-to-your-app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
apns-push-type: alert(priority 10) toapns-push-type: background(priority 5)alertandinterruption-levelfields from the APNS payloadProblem
Remote bolus commands sent via Trio Remote Control appeared to succeed (APNS returned 200) but Trio never received or acted on them. Trio's logs showed no trace of an incoming push notification.
The root cause: when
apns-push-type: alertis used, iOS silently drops the notification if the receiving app (Trio) has not been granted notification permissions by the user. The command never reachedAppDelegate.didReceiveRemoteNotification.Fix
Background push notifications (
content-available: 1,apns-push-type: background, priority 5) are delivered by iOS regardless of notification permission status, which is the correct mechanism for remote command delivery. This matches Apple's documentation requirements — priority 5 is mandatory when usingapns-push-type: background.Test plan