RichPushService
open class RichPushService : UNNotificationServiceExtension
Undocumented
-
Completion block that should always be called regardless if the modification succeeded or failed
Declaration
Swift
public var contentHandler: ((UNNotificationContent) -> Void)? -
The raw version of the received
UNMutableNotificationContent, this will be used if any modification failsDeclaration
Swift
public var bestAttemptContent: UNMutableNotificationContent? -
Undocumented
Declaration
Swift
override open func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) -
Undocumented
Declaration
Swift
override open func serviceExtensionTimeWillExpire()
-
Adds an image as an attachment to the passed
UNMutableNotificationContentif the notification’s payload includes an"image_url"and has valid valueDeclaration
Swift
open func addImageIfNecessary(content: UNMutableNotificationContent, userInfo: [String : Any])Parameters
contentUNMutableNotificationContentuserInfoThe whole push notification payload
-
Creates a
UNNotificationCategorywith its supportedUNNotificationAction(s) depending on the notification’s payload.Declaration
Swift
open func createSupportedCategory(_ userInfo: [String : Any]) -> UNNotificationCategory?Parameters
userInfoThe whole push notification payload
-
Creates a
RichPushCategory.postLikecategory and sets its supported actionsDeclaration
Swift
open func setupPostLikeCategory(_ userInfo: [String : Any]) -> UNNotificationCategoryParameters
userInfoThe whole push notification payload
-
Creates a
RichPushCategory.postLikeCommentcategory and sets its supported actionsDeclaration
Swift
open func setupPostLikeCommentCategory(_ userInfo: [String : Any]) -> UNNotificationCategoryParameters
userInfoThe whole push notification payload
-
Creates a
RichPushCategory.challengecategory and sets its supported actionsDeclaration
Swift
open func setupChallengeCategory(_ userInfo: [String : Any]) -> UNNotificationCategoryParameters
userInfoThe whole push notification payload
-
Creates a
RichPushCategory.offerLinkcategory and sets its supported actionsDeclaration
Swift
open func setupOfferLinkCategory(_ userInfo: [String : Any]) -> UNNotificationCategoryParameters
userInfoThe whole push notification payload
-
Creates a
RichPushCategory.offerCouponcategory and sets its supported actionsDeclaration
Swift
open func setupOfferCouponCategory(_ userInfo: [String : Any]) -> UNNotificationCategoryParameters
userInfoThe whole push notification payload
-
Creates a
RichPushCategory.offerCertificatecategory and sets its supported actionsDeclaration
Swift
open func setupOfferCertificateCategory(_ userInfo: [String : Any]) -> UNNotificationCategoryParameters
userInfoThe whole push notification payload
-
Creates a
RichPushCategory.offerClipcategory and sets its supported actionsDeclaration
Swift
open func setupOfferClipCategory(_ userInfo: [String : Any]) -> UNNotificationCategoryParameters
userInfoThe whole push notification payload
-
Creates a
RichPushCategory.eventFavoritecategory and sets its supported actionsDeclaration
Swift
open func setupEventFavoriteCategory(_ userInfo: [String : Any]) -> UNNotificationCategoryParameters
userInfoThe whole push notification payload
-
Creates a
RichPushCategory.contentPagecategory and sets its supported actionsDeclaration
Swift
open func setupContentPageCategory(_ userInfo: [String : Any]) -> UNNotificationCategoryParameters
userInfoThe whole push notification payload
-
Builder method that creates an instance of
UNNotificationActionDeclaration
Swift
open func createAction(_ action: RichPushAction, title: String, isText: Bool = false, options: UNNotificationActionOptions = []) -> UNNotificationActionParameters
actiontitleText to be displayed on the action button
isTextBoolean flag if action is expecting a text input from the user
optionsUNNotificationActionOptions -
Builder method that creates an instance of
UNNotificationCategoryDeclaration
Swift
open func createCategory(_ category: RichPushCategory, actions: [UNNotificationAction], options: UNNotificationCategoryOptions = []) -> UNNotificationCategoryParameters
categoryactionsList of supported
UNNotificationActionof the category
View on GitHub
RichPushService Class Reference