Created
October 18, 2020 06:20
-
-
Save prafullakumar/8da87031ab8d9f9863226df9f1b4cd19 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
@main | |
struct ios14_demoApp: App { | |
@UIApplicationDelegateAdaptor private var appDelegate: AppDelegate | |
var body: some Scene { | |
WindowGroup { | |
ContentView() | |
} | |
} | |
} | |
class AppDelegate: NSObject, UIApplicationDelegate { | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { | |
return true | |
} | |
//No callback in simulator -- must use device to get valid push token | |
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { | |
} | |
func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) { | |
} | |
func applicationWillResignActive(_ application: UIApplication) { | |
//inactive | |
} | |
func applicationDidEnterBackground(_ application: UIApplication) { | |
//Background | |
} | |
func applicationWillEnterForeground(_ application: UIApplication) { | |
//Foreground | |
} | |
func applicationDidBecomeActive(_ application: UIApplication) { | |
//Active | |
} | |
func applicationWillTerminate(_ application: UIApplication) { | |
//Terminate | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment