Interface UNNotificationContentExtension
-
public interface UNNotificationContentExtension
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceUNNotificationContentExtension.Block_didReceiveNotificationResponseCompletionHandler
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voiddidReceiveNotification(UNNotification notification)This will be called to send the notification to be displayed by the extension.default voiddidReceiveNotificationResponseCompletionHandler(UNNotificationResponse response, UNNotificationContentExtension.Block_didReceiveNotificationResponseCompletionHandler completion)If implemented, the method will be called when the user taps on one of the notification actions.default voidmediaPause()default voidmediaPlay()Called when the user taps the play or pause button.default CGRectmediaPlayPauseButtonFrame()Implementing this method and returning a non-empty frame will make the notification draw a button that allows the user to play and pause media content embedded in the notification.default UIColormediaPlayPauseButtonTintColor()default longmediaPlayPauseButtonType()Implementing this method and returning a button type other that "None" will make the notification attempt to draw a play/pause button correctly styled for that type.
-
-
-
Method Detail
-
didReceiveNotification
void didReceiveNotification(UNNotification notification)
This will be called to send the notification to be displayed by the extension. If the extension is being displayed and more related notifications arrive (eg. more messages for the same conversation) the same method will be called for each new notification.
-
didReceiveNotificationResponseCompletionHandler
default void didReceiveNotificationResponseCompletionHandler(UNNotificationResponse response, UNNotificationContentExtension.Block_didReceiveNotificationResponseCompletionHandler completion)
If implemented, the method will be called when the user taps on one of the notification actions. The completion handler can be called after handling the action to dismiss the notification and forward the action to the app if necessary.
-
mediaPause
default void mediaPause()
-
mediaPlay
default void mediaPlay()
Called when the user taps the play or pause button.
-
mediaPlayPauseButtonFrame
default CGRect mediaPlayPauseButtonFrame()
Implementing this method and returning a non-empty frame will make the notification draw a button that allows the user to play and pause media content embedded in the notification.
-
mediaPlayPauseButtonTintColor
default UIColor mediaPlayPauseButtonTintColor()
-
mediaPlayPauseButtonType
default long mediaPlayPauseButtonType()
Implementing this method and returning a button type other that "None" will make the notification attempt to draw a play/pause button correctly styled for that type.
-
-