Newer Version Available
Build Your Own In-App Notification Feature
- Notification
- Get a specific notification for the context user.
- Notifications
- Get notifications for the context user.
- Notifications Status
- Get the “read” and “seen” properties a range of notifications.
- Notification Update
- Update the “read” and “seen” properties of a specific notification.
- Notifications Update
- Update the “read” and “seen” properties of a range of notifications.
- Display a list of notifications (Notifications)
- When the customer taps a list entry, display the details of a single notification (Notification)
- Set the state of a widget that indicates whether a notification has been read or seen (Notification)
- Report how many notifications the customer hasn’t read or seen (Notifications Status)
- Update the “read” or “seen” properties on one or more notifications after the customer visits your tray (Notification Update, Notifications Update)
Custom In-App Notification Tray Template App
- Install the latest forceios version from
node.js:
- Call the forceios createWithTemplate
command:
- At the first prompt, enter
MobileSyncExplorerSwift:
- In the remaining prompts, enter your company and project information. If your information is accepted, forceios creates a project with a notifications tray that you can customize.
- If you’re updating an older Mobile SDK project, copy your app-specific resources from your old project into the new project.
See the Reference section for more information on Notification APIs.
Mobile SDK iOS Wrappers for Notification APIs
- Swift
-
- Objective-C
-
Notification
Get a notification.
- Swift
-
- Objective-C
-
Block Method
Not available.
Notifications Status
Get the status of a range of notifications, including unread and unseen count.
- Swift
-
- Objective-C
-
Block Method
Not available.
Notifications
Get the given number (maximum 20) of archived Notification Builder notifications based on the given “before” or “after” date. In Mobile SDK, use the Swift FetchNotificationsRequestBuilder object or the Objective-C SFSDKFetchNotificationsRequestBuilder to create GET requests for notifications.
- Swift
-
- Objective-C
-
Block Method
Not available.
Notifications Update
Update the “read” and “seen” statuses of a given set of Notification Builder notifications. In Mobile SDK, use the Swift UpdateNotificationsRequestBuilder object or the Objective-C SFSDKUpdateNotificationsRequestBuilder object to create update requests.
To update a single notification, set the notificationId property. To update a range of notifications, set either the notificationIds or the before property. These properties—notificationId, notificationIds, and before—are mutually exclusive.
- Swift
-
- Objective-C
-
Block Method
Not available.
Mobile SDK Android Wrappers for Notification APIs
On Android, the RestRequest class defines the following convenience wrappers for Notification APIs.
Notification
Get a notification.
Notification Update
Update the “read” and “seen” statuses of a given Notification Builder notification.
Notifications
Get the given number (maximum 20) of archived Notification Builder notifications based on the given “before” or “after” date.
Notifications Status
Get the status of a range of notifications, including unread and unseen count.
Notifications Update
Update the “read” and “seen” statuses of a given set of Notification Builder notifications.