docs/ios-notifications: add new diagram

This commit is contained in:
shum committed 2025-08-21 07:20:32 +00:00
1 parent 0046fc27fe
commit 531f1a43be
3 files changed
+95

No files matched your search

@@ -0,0 +1,90 @@
---
title: "Notifications flow"
---
sequenceDiagram
participant Client
participant NTF
participant SMP
participant Apple
autonumber
Note over Client,NTF: iOS setup app first-time
Client->>NTF:Create token (tknCreated)
NTF->>Apple:Send test notification with secret to APNs
Apple-->>Client:Send test notification with secret to client
Client->>NTF:Verify iOS token (tknVerified)
Note over Client,NTF: iOS creates link
alt Create credentials for queue (new client)
Client->>SMP:ntfNewCreated
else Create credentials for queue (old client)
Client->>SMP:ntfCreated
end
Note over Client,SMP: Subscription phase
Client->>NTF:Create subscription based on credentials (subCreated)
alt Subscription request
NTF->>SMP:ntfSub
else Subscription fail: AUTH
NTF->>SMP:ntfSubAuth
else Subscription fail: Duplicate
NTF->>SMP:ntfSubDuplicate
end
Note over Client,SMP: Notification phase
loop Every minute
SMP-->SMP: Queues with notification<br/>waiting to be delivered (ntfCount1)
end
alt SMP recevies<br/>message with notification
SMP->>SMP:msgRecvNtf
else Client asks SMP to get new message
Client->>SMP:msgGet
else Client sents message with notification flag
Client->>SMP:msgSentNtf
end
alt SMP recevies get
SMP-->>SMP:msgRecvGet
else Prohibited
SMP-->>SMP:msgGetProhibited
else Duplicate
SMP-->SMP:msgGetDuplicate
else AUTH
SMP-->SMP:msgGetAuth
else NoMsg
SMP-->SMP:msgGetNoMsg
end
alt Send notification
SMP->>NTF:msgNtfs
else No subsciptions<br/>(will deliver)
SMP->>SMP:msgNtfNoSub
else Lost<br/>(no delivery)
SMP->>SMP:msgNtfLost
else Expired<br/>(no delivery)
SMP->>SMP:msgNtfExpired
end
NTF-->>NTF:Received notification (ntfReceived)
Note over Client,Apple: Final phase
alt Delivered notification to Apple APNs
NTF-->>Apple:ntfDelivered
else Failed to deliver
NTF-->>Apple:ntfFailed
end
Apple->>Client:Sent notification (visible only via Apple's Console)
Note over Client,SMP: Confirmation phase
Client-->>SMP:Client received (msgRecvNtf)
@@ -0,0 +1 @@
<svg aria-roledescription="sequence" role="graphics-document document" viewBox="-50 -50 1113 3476" height="3436" xmlns="http://www.w3.org/2000/svg" width="1113" id="container"><g><rect class="actor actor-bottom" ry="3" rx="3" name="Apple" height="65" width="150" stroke="#666" fill="#eaeaea" y="3350" x="863"/><text style="text-anchor: middle; font-size: 16px; font-weight: 400;" class="actor actor-box" alignment-baseline="central" dominant-baseline="central" y="3382.5" x="938"><tspan dy="0" x="938">Apple</tspan></text></g><g><rect class="actor actor-bottom" ry="3" rx="3" name="SMP" height="65" width="150" stroke="#666" fill="#eaeaea" y="3350" x="663"/><text style="text-anchor: middle; font-size: 16px; font-weight: 400;" class="actor actor-box" alignment-baseline="central" dominant-baseline="central" y="3382.5" x="738"><tspan dy="0" x="738">SMP</tspan></text></g><g><rect class="actor actor-bottom" ry="3" rx="3" name="NTF" height="65" width="150" stroke="#666" fill="#eaeaea" y="3350" x="463"/><text style="text-anchor: middle; font-size: 16px; font-weight: 400;" class="actor actor-box" alignment-baseline="central" dominant-baseline="central" y="3382.5" x="538"><tspan dy="0" x="538">NTF</tspan></text></g><g><rect class="actor actor-bottom" ry="3" rx="3" name="Client" height="65" width="150" stroke="#666" fill="#eaeaea" y="3350" x="0"/><text style="text-anchor: middle; font-size: 16px; font-weight: 400;" class="actor actor-box" alignment-baseline="central" dominant-baseline="central" y="3382.5" x="75"><tspan dy="0" x="75">Client</tspan></text></g><g><line name="Apple" stroke="#999" stroke-width="0.5px" class="actor-line 200" y2="3350" x2="938" y1="65" x1="938" id="actor3"/><g id="root-3"><rect class="actor actor-top" ry="3" rx="3" name="Apple" height="65" width="150" stroke="#666" fill="#eaeaea" y="0" x="863"/><text style="text-anchor: middle; font-size: 16px; font-weight: 400;" class="actor actor-box" alignment-baseline="central" dominant-baseline="central" y="32.5" x="938"><tspan dy="0" x="938">Apple</tspan></text></g></g><g><line name="SMP" stroke="#999" stroke-width="0.5px" class="actor-line 200" y2="3350" x2="738" y1="65" x1="738" id="actor2"/><g id="root-2"><rect class="actor actor-top" ry="3" rx="3" name="SMP" height="65" width="150" stroke="#666" fill="#eaeaea" y="0" x="663"/><text style="text-anchor: middle; font-size: 16px; font-weight: 400;" class="actor actor-box" alignment-baseline="central" dominant-baseline="central" y="32.5" x="738"><tspan dy="0" x="738">SMP</tspan></text></g></g><g><line name="NTF" stroke="#999" stroke-width="0.5px" class="actor-line 200" y2="3350" x2="538" y1="65" x1="538" id="actor1"/><g id="root-1"><rect class="actor actor-top" ry="3" rx="3" name="NTF" height="65" width="150" stroke="#666" fill="#eaeaea" y="0" x="463"/><text style="text-anchor: middle; font-size: 16px; font-weight: 400;" class="actor actor-box" alignment-baseline="central" dominant-baseline="central" y="32.5" x="538"><tspan dy="0" x="538">NTF</tspan></text></g></g><g><line name="Client" stroke="#999" stroke-width="0.5px" class="actor-line 200" y2="3350" x2="75" y1="65" x1="75" id="actor0"/><g id="root-0"><rect class="actor actor-top" ry="3" rx="3" name="Client" height="65" width="150" stroke="#666" fill="#eaeaea" y="0" x="0"/><text style="text-anchor: middle; font-size: 16px; font-weight: 400;" class="actor actor-box" alignment-baseline="central" dominant-baseline="central" y="32.5" x="75"><tspan dy="0" x="75">Client</tspan></text></g></g><style>#container{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#container .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#container .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#container .error-icon{fill:#552222;}#container .error-text{fill:#552222;stroke:#552222;}#container .edge-thickness-normal{stroke-width:1px;}#container .edge-thickness-thick{stroke-width:3.5px;}#container .edge-pattern-solid{stroke-dasharray:0;}#container .edge-thickness-invisible{stroke-width:0;fill:none;}#container .edge-pattern-dashed{stroke-dasharray:3;}#container .edge-pattern-dotted{stroke-dasharray:2;}#container .marker{fill:#333333;stroke:#333333;}#container .marker.cross{stroke:#333333;}#container svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#container p{margin:0;}#container .actor{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#container text.actor&gt;tspan{fill:black;stroke:none;}#container .actor-line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#container .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333;}#container .messageLine1{stroke-width:1.5;stroke-dasharray:2,2;stroke:#333;}#container #arrowhead path{fillLine truncated

After

Width:  |  Height:  |  Size: 45 KiB

+4
View File
@@ -342,3 +342,7 @@ This threat model compliments SMP, XFTP, push notifications and XRCP protocols t
*cannot:*
- prove that two group members with incognito profiles is the same user.
## Sub-protocol for push notifications
![iOS notifications](./diagrams/ios-notifications.svg)