35 lines
700 B
Swift
35 lines
700 B
Swift
//
|
|
// PushSubscriptionView.swift
|
|
// Tusker
|
|
//
|
|
// Created by Shadowfacts on 4/7/24.
|
|
// Copyright © 2024 Shadowfacts. All rights reserved.
|
|
//
|
|
|
|
import SwiftUI
|
|
import UserAccounts
|
|
import PushNotifications
|
|
|
|
struct PushSubscriptionView: View {
|
|
let account: UserAccountInfo
|
|
@State private var subscription: PushSubscription?
|
|
|
|
@MainActor
|
|
init(account: UserAccountInfo) {
|
|
self.account = account
|
|
self.subscription = PushManager.shared.pushSubscription(account: account)
|
|
}
|
|
|
|
var body: some View {
|
|
if let subscription {
|
|
|
|
} else {
|
|
Text("No notifications")
|
|
}
|
|
}
|
|
}
|
|
|
|
//#Preview {
|
|
// PushSubscriptionView()
|
|
//}
|