Skip to content

Commit ac20d4b

Browse files
committed
Fix Apple multiplatform
1 parent c9a24dc commit ac20d4b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

templates/swift/Sources/NotificationHandler.swift.twig

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
1-
import SwiftUI
21
import JSONCodable
32
import FirebaseCore
43
import FirebaseMessaging
54
import AsyncHTTPClient
65

6+
#if os(iOS) || os(tvOS)
7+
import UIKit
8+
public typealias Application = UIApplication
9+
#elseif os(macOS)
10+
import AppKit
11+
public typealias Application = NSApplication
12+
#elseif os(watchOS)
13+
import WatchKit
14+
public typealias Application = WKApplication
15+
#endif
16+
717
public enum Provider {
818
case fcm, apns
919
}
@@ -17,7 +27,7 @@ open class NotificationHandler {
1727
internal var providerId: String? = nil
1828

1929
public func setup(
20-
_ application: UIApplication,
30+
_ application: Application,
2131
delegate: AppwriteDelegate,
2232
provider: Provider
2333
) {

0 commit comments

Comments
 (0)