Skip to content

Instantly share code, notes, and snippets.

@ysam12345
Last active January 9, 2019 04:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ysam12345/542b5402893b01b42ed98f1685ca9461 to your computer and use it in GitHub Desktop.
Save ysam12345/542b5402893b01b42ed98f1685ca9461 to your computer and use it in GitHub Desktop.
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
//Push Notification Authorization
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { (granted, error) in
}
UIApplication.shared.registerForRemoteNotifications()
// 讓 App 在前景狀態下收到通知
UNUserNotificationCenter.current().delegate = self
//return true
return FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions:launchOptions)
}
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
return FBSDKApplicationDelegate.sharedInstance().application(application, open: url, sourceApplication: sourceApplication, annotation: annotation)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment