Skip to content

Instantly share code, notes, and snippets.

@mfks17
Created September 28, 2016 06:58
Show Gist options
  • Save mfks17/54839374f088f28b9b7fc803ad467cf1 to your computer and use it in GitHub Desktop.
Save mfks17/54839374f088f28b9b7fc803ad467cf1 to your computer and use it in GitHub Desktop.
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
FIRApp.configure()
let types: UIUserNotificationType = [UIUserNotificationType.Badge, UIUserNotificationType.Alert, UIUserNotificationType.Sound]
let settings: UIUserNotificationSettings = UIUserNotificationSettings( forTypes: types, categories: nil )
application.registerUserNotificationSettings( settings )
application.registerForRemoteNotifications()
return true
}
func registerForPushNotifications(application: UIApplication) {
let settings: UIUserNotificationSettings = UIUserNotificationSettings(forTypes: [.Alert, .Badge, .Sound], categories: nil)
application.registerUserNotificationSettings(settings)
application.registerForRemoteNotifications()
}
func tokenRefreshNotificaiton(notification: NSNotification) {
let refreshedToken = FIRInstanceID.instanceID().token()!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment