Parse https invite links (luma.frida.re/l/<code>) alongside the luma:// scheme and route them to the join queue. On iOS deliver universal links via NSUserActivity and open a project from the welcome screen so the queue is consumed. Add the associated-domains entitlement on iOS and macOS.
26 lines
995 B
Swift
26 lines
995 B
Swift
import Foundation
|
|
|
|
public enum BackendConfig {
|
|
public static let portalAddress = "portal.luma.frida.re:27042"
|
|
public static let inviteLinkBase = "https://luma.frida.re/l/"
|
|
public static let pushEnrollURL = "https://luma.frida.re/push-enroll"
|
|
|
|
public static func labID(fromInviteLink url: URL) -> String? {
|
|
guard url.absoluteString.hasPrefix(inviteLinkBase) else { return nil }
|
|
let code = url.absoluteString.dropFirst(inviteLinkBase.count)
|
|
.prefix { $0 != "/" && $0 != "?" && $0 != "#" }
|
|
return code.isEmpty ? nil : String(code)
|
|
}
|
|
|
|
public static let certificate: String = {
|
|
guard let url = Bundle.module.url(forResource: "LumaPortal", withExtension: "pem") else {
|
|
fatalError("LumaPortal.pem not found in LumaCore resources")
|
|
}
|
|
do {
|
|
return try String(contentsOf: url, encoding: .utf8)
|
|
} catch {
|
|
fatalError("Failed to read LumaPortal.pem: \(error)")
|
|
}
|
|
}()
|
|
}
|