Notification Update

Updates the “read” (if non-null) and “seen” (if non-null) statuses of the notification with the given ID.

iOS

In iOS, use the Swift UpdateNotificationsRequestBuilder object or the Objective-C SFSDKUpdateNotificationsRequestBuilder object to create update requests.

Pass the notification’s ID to the notificationId property

Swift
1let builder = UpdateNotificationsRequestBuilder.init()
2builder.setNotificationId("<some_id>")
3builder.setBefore(Date.init())
4builder.setRead(true)
5builder.setSeen(true)
6let request = builder.buildUpdateNotificationsRequest(SFRestDefaultAPIVersion)
Objective-C
1#import <SalesforceSDKCore/SFRestAPI+Notifications.h>
2...
3
4SFSDKUpdateNotificationsRequestBuilder *builder = 
5    [[SFSDKUpdateNotificationsRequestBuilder alloc] init];
6[builder setNotificationId:"<some_id>"]
7[builder setRead:true];
8[builder setSeen:true];
9[builder setBefore: [NSDate date]];
10SFRestRequest *updateRequest = [builder buildUpdateNotificationsRequest:kSFRestDefaultAPIVersion];

Android

Parameters
  • apiVersion (String)
  • notificationId (String)
  • read (Boolean)
  • seen (Boolean)
Kotlin
1fun getRequestForNotificationUpdate(apiVersion: String?, notificationId: String?, 
2    read: Boolean?, seen: Boolean?): RestRequest
Java
1public static RestRequest getRequestForNotificationUpdate(String apiVersion, 
2    String notificationId, Boolean read, Boolean seen)