UserNotification Class

  • java.lang.Object
    • NativeBase
      • com.microsoft.connecteddevices.userdata.usernotifications.UserNotification

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.

UserNotificationPriority getPriority()

Gets the developer specified priority for this user notification.

UserNotificationReadState getReadState()

Gets the value of the read state for this user notification that indicates the notification is read or unread.

UserNotificationStatus getStatus()

Gets the value of the status for this user notification that indicates whether the notification is marked as permanently deleted or not.

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.

AsyncOperation<UserNotificationUpdateResult> 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:

nativeObject

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 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.

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:

readState

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:

userActionState

Applies to