Skip to content

Commit c360b76

Browse files
committed
Add provider as setup parameter
1 parent 586cd1d commit c360b76

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

templates/swift/Sources/NotificationHandler.swift.twig

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,18 @@ public enum Provider {
1111
open class NotificationHandler {
1212
public static let shared = NotificationHandler()
1313

14-
public var provider: Provider = .apns
15-
14+
internal var provider: Provider = .apns
1615
internal var client: Client? = nil
1716
internal var account: Account? = nil
1817
internal var providerId: String? = nil
1918

20-
public func setup(_ application: UIApplication, delegate: AppwriteDelegate) {
19+
public func setup(
20+
_ application: UIApplication,
21+
delegate: AppwriteDelegate,
22+
provider: Provider
23+
) {
24+
self.provider = provider
25+
2126
FirebaseApp.configure()
2227

2328
FirebaseMessaging.Messaging.messaging().delegate = delegate

templates/swift/example-swiftui/Shared/ExampleApp.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class AppDelegate: NSObject, UIApplicationDelegate, AppwriteDelegate {
77
_ application: UIApplication,
88
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil
99
) -> Bool {
10-
NotificationHandler.shared.setup(application, delegate: self)
10+
NotificationHandler.shared.setup(application, delegate: self, provider: .apns)
1111

1212
return true
1313
}

0 commit comments

Comments
 (0)