OrangeChatNotificationManager
open class OrangeChatNotificationManager : UNNotificationServiceExtension
extension OrangeChatNotificationManager: UNUserNotificationCenterDelegate
An object to manage push notifications and redirections related to the SDK.
A notification service app extension does not present any UI of its own. Instead, it is launched on demand when the system delivers a notification of the appropriate type to the device of the user. You use this object to implement the content of notification related to the SDK.
You do not create OrangeChatNotificationManager
objects yourself.
Instead, the Xcode template for a notification service extension target contains a subclass for you to modify.
Here you can use OrangeChatNotificationManager
instead of UNNotificationServiceExtension
.
Also, OrangeChatNotificationManager
provides a way to redirect the user in a conversation upon receipt of a new push notification.
For that, in AppDelegate
you can use OrangeChatNotificationManager
instead of UNUserNotificationCenterDelegate
.
-
The device token for push notifications.
The setter is designed to be called from the
messaging(_:didReceiveRegistrationToken:)
method of theMessagingDelegate
protocol from theFirebase
module.Declaration
Swift
public var deviceToken: String? { get set }
-
Configures the SDK.
This method may be called multiple times but it produces effects only the first time. On next calls, it is a no-operation. It is implicitly called with default arguments when initializing the first
WebcomApplication
instance. So, you should call it before that if you want to use custom arguments.Declaration
Swift
public func configure(groupName: String? = nil)
Parameters
groupName
The app group, used to share data between the main application and extensions.
-
Asks you to make any needed changes to the notification and notify the system when you’re done.
Declaration
Swift
override open func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void)
Parameters
request
The original notification request. Use this object to get the original content of the notification.
contentHandler
The block to execute with the modified content. This block has no return value and takes the following parameter:
contentToDeliver
A
UNNotificationContent
object with the content the system displays to the user. -
Tells you that the system is terminating your extension.
Declaration
Swift
override open func serviceExtensionTimeWillExpire()
-
The name of a notification issued by
OrangeChatNotificationManager
.Declaration
Swift
public static let orangeChatNotificationName: Notification.Name
-
Asks the delegate to process the user’s response to a delivered notification.
Declaration
Swift
open func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void)
Parameters
center
The shared user notification center object that received the notification.
response
The user’s response to the notification. This object contains the original notification and the identifier string for the selected action. If the action allowed the user to provide a textual response, this parameter contains a
UNTextInputNotificationResponse
object.completionHandler
The block to execute when you have finished processing the user’s response. You must execute this block at some point after processing the user’s response to let the system know that you are done. The block has no return value or parameters.