findfamily-ios: use api.maproj.org, drop /api/problem and dead request code
- Commit
2648d994e953bf2bc6c730766dccaa07af74139e- Author
- Vayun Mathur <[email protected]>
- When
- 2026-11-13 22:12 UTC (22 days ago)
- Parents
7bf101c
The server is removing the classic non-PQC, non-WebSocket relay APIs (request_sharing/*, /api/register, /api/getkey, /api/problem). iOS already used only the PQC endpoints and the WebSocket key lookup, except for: - /api/problem: Location.swift posted every CLLocationUpdate diagnostic flag (Auth denied ... Stationary) to it, fire-and-forget. These are now logged on the device only (logger.notice), so a "stationary" phone no longer sends a request per update. - Networking.sendSharingRequest / retrieveSharingRequests (/api/request_sharing/send|retrieve): never called anywhere (iOS, like Android, discovers incoming requests from received locations). Removed together with problem(). Host: every iOS URL moves from the legacy findfamily.cc to the canonical api.maproj.org, matching Android (SHARE_BASE / WS_URL in findfamily/util/Networking.kt): - Networking.baseURL -> https://api.maproj.org - RelayKeyLookup WebSocket -> wss://api.maproj.org/api/ws - copied temporary-link share URLs -> https://api.maproj.org/view/... findfamily.cc keeps serving every path, so installed versions and links already shared keep working. iOS does no certificate pinning and has no ATS host exceptions, so nothing else references the host. Not built here: this Linux devserver has no Swift/xtool toolchain. The change only edits string literals, deletes three uncalled methods (no remaining references, checked with grep) and replaces calls with the file-level `logger` already used in the same closure.
Diff
apple/FindFamily/FindFamilyiOS/Location/Location.swift
diff --git a/apple/FindFamily/FindFamilyiOS/Location/Location.swift b/apple/FindFamily/FindFamilyiOS/Location/Location.swiftindex 31367cb34c..4382e55ba4 100644--- a/apple/FindFamily/FindFamilyiOS/Location/Location.swift+++ b/apple/FindFamily/FindFamilyiOS/Location/Location.swift@@ -51,14 +51,16 @@ final class LocationsHandler: ObservableObject { if let loc = update.location { BackgroundTask.shared.onLocationUpdate(loc, sleep: false) }- if update.authorizationDenied { Task { await Networking.shared.problem("Auth denied") } }- if update.authorizationDeniedGlobally { Task { await Networking.shared.problem("Auth denied globally") } }- if update.authorizationRequestInProgress { Task { await Networking.shared.problem("Auth in progress") } }- if update.authorizationRestricted { Task { await Networking.shared.problem("Auth restricted") } }- if update.insufficientlyInUse { Task { await Networking.shared.problem("Insufficient Use") } }- if update.locationUnavailable { Task { await Networking.shared.problem("Location Unavailable") } }- if update.serviceSessionRequired { Task { await Networking.shared.problem("Service Session required") } }- if update.stationary { Task { await Networking.shared.problem("Stationary") } }+ // Diagnostic flags are logged on the device only (the old /api/problem+ // report endpoint is gone).+ if update.authorizationDenied { logger.notice("Location update: Auth denied") }+ if update.authorizationDeniedGlobally { logger.notice("Location update: Auth denied globally") }+ if update.authorizationRequestInProgress { logger.notice("Location update: Auth in progress") }+ if update.authorizationRestricted { logger.notice("Location update: Auth restricted") }+ if update.insufficientlyInUse { logger.notice("Location update: Insufficient Use") }+ if update.locationUnavailable { logger.notice("Location update: Location Unavailable") }+ if update.serviceSessionRequired { logger.notice("Location update: Service Session required") }+ if update.stationary { logger.notice("Location update: Stationary") } } } catch { logger.error("Could not start location updates: \(error.localizedDescription)")
apple/FindFamily/FindFamilyiOS/Networking/Networking.swift
diff --git a/apple/FindFamily/FindFamilyiOS/Networking/Networking.swift b/apple/FindFamily/FindFamilyiOS/Networking/Networking.swiftindex be2ee2832b..414153d111 100644--- a/apple/FindFamily/FindFamilyiOS/Networking/Networking.swift+++ b/apple/FindFamily/FindFamilyiOS/Networking/Networking.swift@@ -7,7 +7,7 @@ enum NetworkError: Error { /// Thin URLSession wrapper for JSON POST endpoints. final class NetworkClient {- let baseURL = URL(string: "https://findfamily.cc")!+ let baseURL = URL(string: "https://api.maproj.org")! private let session: URLSession init() {@@ -350,33 +350,6 @@ final class Networking: ObservableObject { } } - func sendSharingRequest(to requestedID: Int64) async -> Bool {- let body = encodeJSON([- "requester": .uint64(UInt64(bitPattern: userid)),- "requested": .uint64(UInt64(bitPattern: requestedID)),- ])- return await postBool("/api/request_sharing/send", body: body)- }-- func retrieveSharingRequests() async -> [Int64] {- let body = Data(#"{"requester": \#(UInt64(bitPattern: userid))}"#.utf8)- do {- let (data, http) = try await client.postJSON(path: "/api/request_sharing/retrieve", jsonBody: body)- networkIsDown = false- guard http.statusCode == 200 else { return [] }- let arr = (try? JSONDecoder().decode([String].self, from: data)) ?? []- return arr.compactMap { UInt64($0).map { Int64(bitPattern: $0) } }- } catch {- checkNetworkDown(error)- return []- }- }-- func problem(_ message: String) async {- let body = encodeJSON(["problem": .string(message)])- _ = await postBool("/api/problem", body: body)- }- // MARK: - UWB session-setup channel (post-quantum only) /// Publishes [envelope] to [recipientID] via the peer's PQC bundle. Returns false if the peer@@ -451,7 +424,7 @@ final class Networking: ObservableObject { do { let (_, http) = try await client.postJSON(path: path, jsonBody: body) networkIsDown = false- // Server returns 200 *or* 204 No Content on success for register/publish/problem.+ // Server returns 200 *or* 204 No Content on success for register/publish. return (200..<300).contains(http.statusCode) } catch { checkNetworkDown(error)
apple/FindFamily/FindFamilyiOS/Networking/RelayKeyLookup.swift
diff --git a/apple/FindFamily/FindFamilyiOS/Networking/RelayKeyLookup.swift b/apple/FindFamily/FindFamilyiOS/Networking/RelayKeyLookup.swiftindex 9f09dc3c1d..2f93248b17 100644--- a/apple/FindFamily/FindFamilyiOS/Networking/RelayKeyLookup.swift+++ b/apple/FindFamily/FindFamilyiOS/Networking/RelayKeyLookup.swift@@ -32,7 +32,7 @@ enum RelayKeyLookup { let bundle: Data? } - private static let url = URL(string: "wss://findfamily.cc/api/ws")!+ private static let url = URL(string: "wss://api.maproj.org/api/ws")! /// Matches the Android client's GETKEY timeout. private static let timeout: TimeInterval = 5
apple/FindFamily/FindFamilyiOS/UI/Cards.swift
diff --git a/apple/FindFamily/FindFamilyiOS/UI/Cards.swift b/apple/FindFamily/FindFamilyiOS/UI/Cards.swiftindex f03b9a8f2d..04a6eb89e4 100644--- a/apple/FindFamily/FindFamilyiOS/UI/Cards.swift+++ b/apple/FindFamily/FindFamilyiOS/UI/Cards.swift@@ -158,9 +158,9 @@ struct TemporaryLinkCard: View { // send just the 32-byte ML-KEM seed (`#s=`) with a Base26 id, which fits in an // SMS; links minted before that still carry their full private bundle. if let seed = link.pqcSeed {- Platform.copy("https://findfamily.cc/view/\(Base26.encode(link.id))#s=\(seed)")+ Platform.copy("https://api.maproj.org/view/\(Base26.encode(link.id))#s=\(seed)") } else if let pqcKey = link.pqcKey {- Platform.copy("https://findfamily.cc/view/\(UInt64(bitPattern: link.id))#pqc_key=\(pqcKey)")+ Platform.copy("https://api.maproj.org/view/\(UInt64(bitPattern: link.id))#pqc_key=\(pqcKey)") } } label: { Image(systemName: "doc.on.doc") } Button(role: .destructive) {