UserNotification Class
- java.
lang. Object - NativeBase
- com.
microsoft. connecteddevices. userdata. usernotifications. UserNotification
- com.
public class UserNotification
This class represents a single user notification instance. A user notification is created and published by your app server targeted at a user, distributed to all device endpoints of the same logged in user.
Constructor Summary
Constructor | Description | |
---|---|---|
UserNotification(NativeObject nativeObject) |
Method Summary
Modifier and Type | Method and Description |
---|---|
Date |
getChangeTime()
Gets timestamp of when the latest change was applied to this notification. |
String |
getContent()
Gets the content payload for this notification which is developer defined arbitrary data. |
Date |
getExpirationTime()
Gets the expiration time for this user notification. |
String |
getGroupId()
Gets the developer specified group id for this user notification. |
String |
getId()
Gets the developer specified unique id for this user notification. |
User |
getPriority()
Gets the developer specified priority for this user notification. |
User |
getReadState()
Gets the value of the read state for this user notification that indicates the notification is read or unread. |
User |
getStatus()
Gets the value of the status for this user notification that indicates whether the notification is marked as permanently deleted or not. |
User |
getUserActionState()
Gets the value of the user action state for a user notification to determine whether the notification is not interacted, dismissed, activated, or snoozed. |
Async |
saveAsync()
This should be called when publishing user notification changes. This method should be called whenever the app modifies an updatable property of the UserNotification. |
void |
setReadState(@NonNull UserNotificationReadState readState)
Sets the read state for this user notification, the change once made and saved will be published to all devices. |
void |
setUserActionState(@NonNull UserNotificationUserActionState userActionState)
Sets the user action state for this user notification, the change once made and saved will be published to all devices. |
Constructor Details
UserNotification
protected UserNotification(NativeObject nativeObject)
Parameters:
Method Details
getChangeTime
public Date getChangeTime()
Gets timestamp of when the latest change was applied to this notification.
getContent
public String getContent()
Gets the content payload for this notification which is developer defined arbitrary data.
getExpirationTime
public Date getExpirationTime()
Gets the expiration time for this user notification.
getGroupId
public String getGroupId()
Gets the developer specified group id for this user notification.
getId
public String getId()
Gets the developer specified unique id for this user notification.
getPriority
public UserNotificationPriority getPriority()
Gets the developer specified priority for this user notification.
getReadState
public UserNotificationReadState getReadState()
Gets the value of the read state for this user notification that indicates the notification is read or unread.
getStatus
public UserNotificationStatus getStatus()
Gets the value of the status for this user notification that indicates whether the notification is marked as permanently deleted or not.
getUserActionState
public UserNotificationUserActionState getUserActionState()
Gets the value of the user action state for a user notification to determine whether the notification is not interacted, dismissed, activated, or snoozed.
saveAsync
public AsyncOperation
This should be called when publishing user notification changes. This method should be called whenever the app modifies an updatable property of the UserNotification.
setReadState
public void setReadState(@NonNull UserNotificationReadState readState)
Sets the read state for this user notification, the change once made and saved will be published to all devices.
Parameters:
setUserActionState
public void setUserActionState(@NonNull UserNotificationUserActionState userActionState)
Sets the user action state for this user notification, the change once made and saved will be published to all devices.
Parameters: