- Fixed App Store icon display with ios-marketing idiom - Added iPad orientation support for multitasking - Added UILaunchScreen for iPad requirements - Removed unused BLE permissions and files from build Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
107 lines
4.5 KiB
Swift
107 lines
4.5 KiB
Swift
import Foundation
|
|
import CoreLocation
|
|
|
|
/// Static list of Payfrit shard UUIDs for iBeacon scanning.
|
|
///
|
|
/// Apps scan for ALL these UUIDs. The backend handles resolution.
|
|
/// If we need more capacity, ship more UUIDs in a future app version.
|
|
enum BeaconShardPool {
|
|
|
|
/// All Payfrit shard UUIDs as strings (from BeaconShards database table).
|
|
static let uuidStrings: [String] = [
|
|
"34b8cd87-1905-47a9-a7b7-fad8a4c011a1",
|
|
"5ee62089-8599-46f7-a399-d40c2f398712",
|
|
"fd3790ac-33eb-4091-b1c7-1e0615e68a87",
|
|
"bfce1bc4-ad2a-462a-918b-df26752c378d",
|
|
"845b64c7-0c91-41cd-9c30-ac56b6ae5ca1",
|
|
"7de0b2fb-69a3-4dbb-9808-8f33e2566661",
|
|
"54c34c7e-5a9b-4738-a4b4-2e228337ae3c",
|
|
"70f9fc09-25e6-46ec-8395-72f487877a1a",
|
|
"f8cef0af-6bef-4ba6-8a5d-599d647b628c",
|
|
"41868a10-7fd6-41c6-9b14-b5ca33c11471",
|
|
"25e1044d-446b-4403-9abd-1e15f806dfe9",
|
|
"cdeefaf0-bf95-4dab-8bd5-f7b261f9935d",
|
|
"bf3b156a-a0fb-4bad-b3fd-0b408ffc9d6e",
|
|
"11b7c63e-a61d-4530-a447-2cb8e6a30a45",
|
|
"d0519f2d-97a1-4484-a2c2-57135affe427",
|
|
"d2d1caa9-aa89-4c9d-93b1-d6fe1527f622",
|
|
"6f65071f-e060-44e7-a6f9-5dae49cbf095",
|
|
"4492bbbb-8584-421a-8f26-cb20c7727ead",
|
|
"73bc2b23-9cf8-4a93-8bfc-5cf44f03a973",
|
|
"70129c14-78ed-447e-ab9e-638243f8bdae",
|
|
"6956f91b-e581-48a5-b364-181662cb2f9f",
|
|
"39fc9b45-d1b3-4d97-aa82-a52457bf808f",
|
|
"ef150f40-5e24-4267-a1d0-b5ea5ce66c99",
|
|
"ac504bbd-fbdb-46d0-83c0-cdf53e82cdf8",
|
|
"bbecefd2-7317-4fd4-93d9-2661df8c4762",
|
|
"b252557a-e998-4b28-9d7d-bc9a8c907441",
|
|
"527b504c-d363-438a-bb65-2db1db6cb487",
|
|
"ea5eef55-b7e9-4866-a4a1-8b4a1f6ea79d",
|
|
"40a5d0c8-727a-47db-8ffd-154bfc36e03d",
|
|
"4d90467e-5f68-41ef-b4ec-2b2c8ec1adce",
|
|
"1cc513ee-627a-4cfe-b162-7cea3cb1374e",
|
|
"2913ab6e-ab0d-4666-bff1-7fe3169c4f55",
|
|
"7371381a-f2aa-4a40-b497-b06e66d51a31",
|
|
"e890450f-0b8d-4a5a-973e-5af37233c13b",
|
|
"d190eef0-59ee-44bc-a459-e0d5b767b26f",
|
|
"76ebe90f-f4b2-45d4-9887-841b1ddd3ca9",
|
|
"7fbed5b0-a212-4497-9b54-9831e433491b",
|
|
"3d41e7b0-5d91-4178-81c1-de42ab6b3466",
|
|
"5befd90a-7967-4fe5-89ba-7a9de617d507",
|
|
"e033235c-f69d-4018-a197-78e7df59dfa3",
|
|
"71edc8b9-b120-415a-a1d4-77bdd8e30f14",
|
|
"521de568-a0e6-4ec9-bf1c-bdb7b9f9cae2",
|
|
"a28db91b-c18f-4b4b-804f-38664d3456cc",
|
|
"5738e431-25bc-4cc1-a4e2-da8c562075b3",
|
|
"f90b7c87-324b-4fd5-b2ff-acf6800f6bd0",
|
|
"bd4ea89c-f99d-4440-8e27-d295836fd09d",
|
|
"b5c2d016-1143-4bb2-992b-f08fb073ef2c",
|
|
"0bb16d1a-f970-4baf-b410-76e5f1ff7c9e",
|
|
"b4f22e62-4052-4c58-a18b-38e2a5c04b9a",
|
|
"b8150be6-0fbd-4bb9-9993-a8a2992d5003",
|
|
"50d2d4c6-1907-4789-afe2-3b28baa3c679",
|
|
"ee42778d-53c9-42c9-8dfa-87a509799990",
|
|
"6001ee07-fc35-45f7-8ef6-afc30371bd73",
|
|
"0761bede-deb6-4b08-bfbb-10675060164a",
|
|
"c03ac1de-a7ea-490a-b3a9-7cc5e8ab4dd1",
|
|
"57ecd21d-76b1-4016-8c86-7c5a861aae67",
|
|
"f119066c-a4e2-4b2e-aef3-6a0bf6b288bc",
|
|
"e2c2ccff-d651-488f-9d74-4ecf4a0487e0",
|
|
"7d5ba66c-d8f8-4d54-9900-4c52b5667682",
|
|
"1b0f57f9-0c02-43a5-9740-63acbc9574a0",
|
|
"314fdc08-fbfd-4bd8-aaae-e579d9ef567d",
|
|
"5835398b-95ac-44ba-af78-a5d3dc4fc0ad",
|
|
"3eb1baca-84bb-4d85-8860-42a9df3b820e",
|
|
"da73ba99-976c-4e81-894a-d799e05f9186"
|
|
]
|
|
|
|
/// All Payfrit shard UUIDs as UUID objects.
|
|
static let uuids: [UUID] = uuidStrings.compactMap { UUID(uuidString: $0) }
|
|
|
|
/// Check if a UUID is a Payfrit shard.
|
|
static func isPayfrit(_ uuid: UUID) -> Bool {
|
|
return uuids.contains(uuid)
|
|
}
|
|
|
|
/// Check if a UUID string is a Payfrit shard.
|
|
static func isPayfrit(_ uuidString: String) -> Bool {
|
|
guard let uuid = UUID(uuidString: uuidString) else { return false }
|
|
return isPayfrit(uuid)
|
|
}
|
|
|
|
/// Create CLBeaconRegions for all Payfrit shards (for ranging).
|
|
static func createRegions() -> [CLBeaconRegion] {
|
|
return uuids.enumerated().map { index, uuid in
|
|
CLBeaconRegion(uuid: uuid, identifier: "payfrit-shard-\(index)")
|
|
}
|
|
}
|
|
|
|
/// Create a CLBeaconRegion for a specific business (for background monitoring).
|
|
static func createBusinessRegion(uuid: UUID, major: UInt16) -> CLBeaconRegion {
|
|
return CLBeaconRegion(
|
|
uuid: uuid,
|
|
major: CLBeaconMajorValue(major),
|
|
identifier: "payfrit-business-\(major)"
|
|
)
|
|
}
|
|
}
|