5bc81d5b3b
iOS SwiftUI app with Supabase auth/realtime, Node.js backend, Docker/Supabase self-hosted infrastructure, and APNs scheduler. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
36 lines
1.2 KiB
Swift
36 lines
1.2 KiB
Swift
import Foundation
|
|
|
|
/// Konfiguration aus dem Xcode Build-System (xcconfig / Info.plist).
|
|
///
|
|
/// Setup:
|
|
/// 1. Datei `Config.xcconfig` im Projektverzeichnis anlegen (nicht committen!):
|
|
/// SUPABASE_URL = https://api.xxx.dk0.dev
|
|
/// SUPABASE_ANON_KEY = eyJhbGci...
|
|
///
|
|
/// 2. In Xcode: Project → Info → Configurations → Debug & Release auf Config.xcconfig setzen
|
|
/// 3. In Info.plist eintragen:
|
|
/// SUPABASE_URL → $(SUPABASE_URL)
|
|
/// SUPABASE_ANON_KEY → $(SUPABASE_ANON_KEY)
|
|
|
|
enum Config {
|
|
static let supabaseURL: URL = {
|
|
guard
|
|
let raw = Bundle.main.object(forInfoDictionaryKey: "SUPABASE_URL") as? String,
|
|
!raw.isEmpty,
|
|
let url = URL(string: raw)
|
|
else {
|
|
// Fallback für Entwicklung — ersetze mit deiner URL
|
|
return URL(string: "https://api.xxx.dk0.dev")!
|
|
}
|
|
return url
|
|
}()
|
|
|
|
static let supabaseAnonKey: String = {
|
|
let key = Bundle.main.object(forInfoDictionaryKey: "SUPABASE_ANON_KEY") as? String ?? ""
|
|
if key.isEmpty {
|
|
print("⚠️ SUPABASE_ANON_KEY nicht gesetzt — Config.xcconfig prüfen")
|
|
}
|
|
return key
|
|
}()
|
|
}
|