Skip to content
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

sync service: add support for APNS #158

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tburgin
Copy link
Contributor

@tburgin tburgin commented Dec 4, 2024

This CL lays the groundwork for using APNS with a sync server. Baring hacky workarounds, APNS must be registered by a process running in the GUI domain. The sync service runs in the global domain and cannot register for APNS itself. Most of the complexity of this CL is to handle APNS registration from the GUI process, while continuing to use the sync service for communications with the sync server.

sequenceDiagram
    box Mac
    participant GUI 2
    participant GUI
    participant Daemon
    participant Sync Service
    end
    box Network
    participant Sync Server
    participant Apple APNs
    end

    GUI->>Apple APNs: Register for APNS
    Sync Service->>Daemon: Get APNS Token
    Daemon->>GUI: Get APNS Token
    GUI->>GUI: Wait for APNS Registration
    Apple APNs-->>GUI: APNS Token
    GUI-->>Daemon: Token in reply block
    Daemon-->>Sync Service:  Token in reply block
    Sync Service->>Sync Server: Token 1
    Sync Server->>Apple APNs: Message Targeting Token 1
    Apple APNs->>GUI: Message
    GUI->>Sync Service: Forward Message

    GUI 2->GUI 2: Fast User Switch & APNS Register
    GUI 2->>Sync Service: Token Changed
    Sync Service->>Daemon: Get APNS Token
    Daemon->>GUI 2: Get APNS Token
    GUI 2-->>Daemon: Token in reply block
    Daemon-->>Sync Service:  Token in reply block
    Sync Service->>Sync Server: Token 2
    Sync Server->>Apple APNs: Message Targeting Token 2
    Apple APNs->>GUI 2: Message
    GUI 2->>Sync Service: Forward Message


Loading

@tburgin tburgin requested a review from a team as a code owner December 4, 2024 19:41
Source/common/SNTConfigurator.m Show resolved Hide resolved
Source/gui/SNTAppDelegate.m Show resolved Hide resolved
Source/gui/SNTAppDelegate.m Show resolved Hide resolved
Source/gui/SNTAppDelegate.m Show resolved Hide resolved
Source/gui/SNTNotificationManager.m Outdated Show resolved Hide resolved
Source/santasyncservice/SNTPushClientAPNS.h Outdated Show resolved Hide resolved
Source/santasyncservice/SNTPushClientAPNS.m Outdated Show resolved Hide resolved
Source/santasyncservice/SNTPushClientAPNS.m Outdated Show resolved Hide resolved
Source/santasyncservice/SNTPushClientFCM.h Outdated Show resolved Hide resolved
Source/santasyncservice/SNTPushClientAPNS.m Show resolved Hide resolved
russellhancox
russellhancox previously approved these changes Dec 5, 2024
@pmarkowsky pmarkowsky added sync protocol Issues or PRs related to the sync protocol 🎅🏻 gui labels Dec 6, 2024
@pmarkowsky pmarkowsky added this to the 2025.1 milestone Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎅🏻 gui sync protocol Issues or PRs related to the sync protocol
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants