-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathApp.swift
More file actions
executable file
·40 lines (36 loc) · 1.35 KB
/
App.swift
File metadata and controls
executable file
·40 lines (36 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//
// App.swift
// UIKitPlusExample
//
// Created by Mihael Isaev on 29.01.2021.
// Copyright © 2021 Swift Stream. All rights reserved.
//
import UIKitPlus
class App: BaseApp {
@AppBuilder override var body: AppBuilderContent {
Lifecycle.didFinishLaunching {
self.$pushNotificationToken.listen { token in
// handle your push token here
print("push token: \(token ?? "n/a")")
}
// request push token authorization like this
App.requestPushNotificationsAuthorization(.alert, .sound, .badge)
}.willResignActive {
}.willEnterForeground {
}
MainScene { .main } // you could check authorization here and show other screens like .login or .splash or your custom
.mainScreen {
NavigationController(MainViewController()).style(.transparent).hideNavigationBar()
}
// .splashScreen {
// SplashViewController()
// }
// .loginScreen {
// NavigationController(WelcomeViewController()).style(.transparent).hideNavigationBar()
// }
// Shortcuts {
// Shortcut("A").title("Test 1").icon(type: .audio)
// Shortcut("B").title("Test 2").subTitle("Hello world").icon(type: .bookmark)
// }
}
}