UAPush
@objc
public final class UAPush : NSObject, Sendable
This singleton provides an interface to the functionality provided by the Airship iOS Push API.
-
Enables/disables background remote notifications on this device through Airship. Defaults to
true
.Declaration
Swift
@objc @MainActor public var backgroundPushNotificationsEnabled: Bool { get set }
-
Enables/disables user notifications on this device through Airship. Defaults to
false
. Once set totrue
, the user will be prompted for remote notifications.Declaration
Swift
@objc public var userPushNotificationsEnabled: Bool { get set }
-
When enabled, if the user has ephemeral notification authorization the SDK will prompt the user for notifications. Defaults to
false
.Declaration
Swift
@objc public var requestExplicitPermissionWhenEphemeral: Bool { get set }
-
The device token for this device, as a hex string.
Declaration
Swift
@objc @MainActor public var deviceToken: String? { get }
-
User Notification options this app will request from APNS. Changes to this value will not take effect until the next time the app registers with updateRegistration.
Defaults to alert, sound and badge.
Declaration
Swift
@objc public var notificationOptions: UNAuthorizationOptions { get set }
-
Custom notification categories. Airship default notification categories will be unaffected by this field.
Changes to this value will not take effect until the next time the app registers with updateRegistration.
Declaration
Swift
@objc @MainActor public var customCategories: Set<UNNotificationCategory> { get set }
-
The combined set of notification categories from
customCategories
set by the app and the Airship provided categories.Declaration
Swift
@objc @MainActor public var combinedCategories: Set<UNNotificationCategory> { get }
-
Sets authorization required for the default Airship categories. Only applies to background user notification actions.
Changes to this value will not take effect until the next time the app registers with updateRegistration.
Declaration
Swift
@objc @MainActor public var requireAuthorizationForDefaultCategories: Bool { get set }
-
Notification response that launched the application.
Declaration
Swift
@objc public var launchNotificationResponse: UNNotificationResponse? { get }
-
setBadgeNumber(_:
Asynchronous) Sets the badge number.
Declaration
Swift
@objc public func setBadgeNumber(_ badge: Int) async throws
Parameters
badge
The badge to set
-
Gets the badge number.
Declaration
Swift
@objc @MainActor public var badgeNumber: Int { get }
-
Enables/disables auto badge.
Declaration
Swift
@objc public var autobadgeEnabled: Bool { get set }
-
resetBadge()
AsynchronousResets the badge.
Declaration
Swift
@objc @MainActor public func resetBadge() async throws
-
Time Zone for quiet time. If the time zone is not set, the current local time zone is returned.
Declaration
Swift
@objc public var timeZone: NSTimeZone? { get set }
-
Enables/Disables quiet time
Declaration
Swift
@objc public var quietTimeEnabled: Bool { get set }