PushFeature
@objc(SFPushFeature)
public final class PushFeature: NSObject,
SFMCModule,
Subscriber,
Publisher
extension PushFeature: PushFeatureApi
The main API class of PushFeature module
-
Requests the Push Feature Module when it’s operational and safe to use. The provided callback will be invoked with the Push Feature Module when it’s ready. All push feature module-related API calls should be made within this function.
Declaration
Swift
@objc public static func requestSdk(_ callback: @escaping (_ pushFeature: PushFeatureApi?) -> Void)Parameters
callbackA callback that will receive the Push Feature Module when it’s operational/ready.
-
Responsible for sending the Apple device token back to all the subscribers. It marks the end of the token registration flow. If it is unable to reach Salesforce server, it will save the token and try again later. This method is necessary to the implementation of Salesforce Push.
Declaration
Swift
public func setDeviceToken(_ deviceToken: Data)Parameters
deviceTokenDevice token received from the customer application.
-
Returns the device token as a String.
Declaration
Swift
public func deviceToken() -> String?
-
Developer override to set the state of push enablement to true/false. If set to false, the application will not receive any push notifications once the Marketing Cloud server has been updated. When this value is false, it takes precedence (overrides) the user notifications settings (i.e., setting this to false will always disable push.) Conversely, if the user has notifications settings disabled, the developer cannot enable push via this method. A false value from either source (user settings or developer interface) always wins.
Declaration
Swift
public func setPushEnabled(pushEnabled: Bool)Parameters
pushEnabledSet to true to enable push notifications.
-
Combination of push enabled from user notifications settings and push enabled by sdk.
Declaration
Swift
public func isPushEnabled() -> Bool
-
Informs the module of the current notification response when user clicks a notification.
Declaration
Swift
public func setNotificationResponse(_ response: UNNotificationResponse) -
Returns the last notification response delivered to the module.
Declaration
Swift
public func notificationResponse() -> UNNotificationResponse? -
Informs the module of the current userInfo when user clicks a notification.
Declaration
Swift
public func setNotificationUserInfo(_ userInfo: [AnyHashable : Any])Parameters
userInfoThe user info the current notification clicked to the module.
-
Returns the user info of the last notification delivered to the module.
Declaration
Swift
public func notificationUserInfo() -> [AnyHashable : Any]
-
Set URLHandling delegate to handle URLs in OpenDirect URLs, CloudPage URLs, CloudPage URLs from inbox messages
Declaration
Swift
public func setURLHandlingDelegate(_ delegate: URLHandlingDelegate)Parameters
delegateset the delegate to handle URLs
PushFeature Class Reference