Swift 2:
let settings = UIUserNotificationSettings(forTypes: [.Alert, .Badge, .Sound], categories: nil)
UIApplication.sharedApplication().registerUserNotificationSettings(settings)
UIApplication.sharedApplication().registerForRemoteNotifications()
More Related Contents:
- How to send a silent Push Notification payload
- iOS push notification: how to detect if the user tapped on notification when the app is in background?
- It’s possible to change push notification message before display on device from iOS side?
- How to catch all iOS Push Notifications with different user actions including tap on app icon
- Local and Push Notifications in IOS version compatible
- How do I make an HTTP request in Swift?
- How to convert a UIView to an image
- Create thread safe array in Swift
- Add an element to an array in Swift
- UIButton action in table view cell
- Xcode, where to assign the segue identifier
- Request Permission for Camera and Library in iOS 10 – Info.plist
- Trying to convert Firebase timestamp to NSDate in Swift
- How can I use an .a static library in swift?
- Changing navigation bar color in Swift
- How to implement the Hashable Protocol in Swift for an Int array (a custom string struct)
- didReceiveRemoteNotification not working in the background
- What is the difference between a property and a variable in Swift?
- [NSObject : AnyObject]?’ does not have a member named ‘subscript’ error in Xcode 6 beta 6
- What is export * in module.modulemap file inside each framework?
- Custom UITableViewCell programmatically using Swift
- Get an array of property values from an object array
- How to logout user using Facebook authentication using Swift and iOS?
- xcode 7.1 swift framework app builds but not archiving
- Repeating local notification daily at a set time with swift
- iOS Push Notification Banner shown twice for a single Push
- Using UIPageViewController with swift and multiple view controllers
- Convert date string swift
- Can we add text, shape and signature in Photo Markup with Pencil Kit?
- SwiftUI – Detect when ScrollView has finished scrolling?