Notifications Update

Updates the “read” (if non-null) and “seen” (if non-null) statuses of notifications with the given IDs, or those sent before the given date.

iOS

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

To define the range of affected notifications, pass either an array of notification IDs or a “before” date. The ID array and “before” date are mutually exclusive parameters.

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

Android

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

      OR

    • before (Date)
  • read (Boolean)
  • seen (Boolean)
1public static RestRequest getRequestForNotificationsUpdate(String apiVersion, 
2    List<String> notificationIds, Date before, Boolean read, Boolean seen)