Skip to content

Add remote commands via APNS for Loop users #434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: dev
Choose a base branch
from

Conversation

codebymini
Copy link
Collaborator

@codebymini codebymini commented Jul 9, 2025

Summary
This commit implements remote commands via APNS (Apple Push Notification Service) for caregivers to Loop users, adding a new communication method for sending commands to Loop devices.

Key Changes
🆕 New Features:
APNS-based remote commands - New communication channel for Loop users
TOTP authentication - Added TOTP generator for secure authentication
QR code scanner - Simple QR code scanning functionality
Override presets - New system for managing and applying override presets
Enhanced remote settings - Improved remote configuration management

📱 New Views & Services:
LoopAPNSBolusView - Remote bolus commands interface
LoopAPNSCarbsView - Remote carb entry interface
LoopAPNSService - Core APNS communication service
LoopAPNSSettingsView - APNS configuration settings
OverridePresetsView - Override preset management

🗑️ Removed:
Legacy Loop Nightscout remote views (LoopNightscoutRemoteView, LoopOverrideView, LoopOverrideViewModel)

�� Infrastructure:
Updated project configuration and dependencies
Enhanced storage system for new remote features
Added necessary permissions and capabilities to Info.plist
Validation of Loop APNS key format

Introduces a more robust and secure remote command system
Replaces the previous Nightscout-based remote functionality with APNS-based communication
This represents a significant architectural improvement for remote Loop control, moving from Nightscout-based commands to a more direct and secure APNS-based approach.

@codebymini codebymini force-pushed the loop-remote-commands-apns branch 2 times, most recently from 1db6ba2 to d5ce515 Compare July 9, 2025 22:48
@bjorkert bjorkert requested a review from marionbarker July 17, 2025 15:00
@marionbarker
Copy link
Collaborator

The app stops responding when modifying various rows in the Configure Loop APNS Settings section.

Enclosed is the most recent ips file from my iPhone 15 pro.

Loop Follow-2025-07-17-154247.ips.zip

Once configured, the remote commands worked well. I'll do more testing after the crash is fixed and the branch conflicts are resolved.

@marionbarker
Copy link
Collaborator

I tested again. (I used the latest commit, d593cce, merged dev to it and resolved the conflict).

I can select all and remove each of the items in:

  • LOOP APNS KEY ID
  • LOOP DEVELOPER TEAM ID
  • LOOP APNS KEY

I can then add each item back in.

I can use the Camera to rescan the QR code URL if the row is already filled out.

  • If I clear that row - the app hangs, when I restart, it is cleared
  • If the row is cleared and I use the camera to scan, the app hangs but when I restart, the row is filled in

With this crash I am getting ips files on the SE 2nd gen but not on the iPhone 15 pro, even though they both act the same. Here's one:

@codebymini codebymini force-pushed the loop-remote-commands-apns branch from 95183f5 to 33b2054 Compare July 18, 2025 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants