Instance Method

enabledRemoteNotificationTypes()

Returns the types of notifications the app accepts.

Declaration

func enabledRemoteNotificationTypes() -> UIRemoteNotificationType

Return Value

A bit mask whose values indicate the types of notifications the user has requested for the app. See UIRemoteNotificationType for valid bit-mask values.

Discussion

The values in the returned bit mask indicate the types of notifications currently enabled for the app. These types are first set when the app calls the registerForRemoteNotifications(matching:) method to register itself with Apple Push Notification service. Thereafter, the user may modify these accepted notification types in the Notifications preference of the Settings app. This method returns those initial or modified values. iOS does not display or play notification types specified in the notification payload that are not one of the enabled types. For example, the app might accept icon-badging as a form of notification, but might reject sounds and alert messages, even if they are specified in the notification payload.

See Also

Deprecated Symbols

func registerUserNotificationSettings(UIUserNotificationSettings)

Registers your preferred options for notifying the user.

Deprecated
var currentUserNotificationSettings: UIUserNotificationSettings?

Returns the user notification settings for the app.

Deprecated
struct UIRemoteNotificationType

Constants indicating the types of notifications the app may display to the user.

Deprecated
func openURL(URL) -> Bool

Attempts to open the resource at the specified URL.

Deprecated
func scheduleLocalNotification(UILocalNotification)

Schedules a local notification for delivery at its encapsulated date and time.

Deprecated
func presentLocalNotificationNow(UILocalNotification)

Presents a local notification immediately.

Deprecated
func cancelLocalNotification(UILocalNotification)

Cancels the delivery of the specified scheduled local notification.

Deprecated
func cancelAllLocalNotifications()

Cancels the delivery of all scheduled local notifications.

Deprecated
var scheduledLocalNotifications: [UILocalNotification]?

All currently scheduled local notifications.

Deprecated
func setNewsstandIconImage(UIImage?)

Sets the icon of a Newsstand app to an image depicting the current issue of a publication.

Deprecated
func setKeepAliveTimeout(TimeInterval, handler: (() -> Void)? = nil) -> Bool

Configures a periodic handler for VoIP apps in older versions of iOS.

Deprecated
func clearKeepAliveTimeout()

Removes a previously installed periodic handler block.

Deprecated
func setStatusBarHidden(Bool, with: UIStatusBarAnimation)

Hides or shows the status bar, optionally animating the transition.

Deprecated
var isStatusBarHidden: Bool

A Boolean value that determines whether the status bar is hidden.

Deprecated
func setStatusBarStyle(UIStatusBarStyle, animated: Bool)

Sets the style of the status bar, optionally animating the transition to the new style.

Deprecated
var statusBarStyle: UIStatusBarStyle

The current style of the status bar.

Deprecated
func setStatusBarOrientation(UIInterfaceOrientation, animated: Bool)

Sets the app's status bar to the specified orientation, optionally animating the transition.

Deprecated
var statusBarOrientation: UIInterfaceOrientation

The current orientation of the app's status bar.

Deprecated
func registerForRemoteNotifications(matching: UIRemoteNotificationType)

Register to receive remote notifications of the specified types via Apple Push Notification service.

Deprecated