NotificationsApi
@interface NotificationsApi : NodeDependant
Provides access to Textile notifications related APIs
-
List notifications
Declaration
Objective-C
- (id)list:(nullable NSString *)offset limit:(long)limit error:(NSError *_Nullable *_Nullable)error;
Swift
func list(_ offset: String?, limit: Int) throws -> Any
Parameters
offset
The offset to query from
limit
The max number of notifications to return
error
A reference to an error pointer that will be set in the case of an error
Return Value
An object containing a list of notifications
-
Declaration
Objective-C
- (long)countUnread;
Swift
func countUnread() -> Int
Return Value
The number of unread notifications
-
Mark a notification as read
Declaration
Objective-C
- (void)read:(nonnull NSString *)notificationId error:(NSError *_Nullable *_Nullable)error;
Swift
func read(_ notificationId: String, error: NSErrorPointer)
Parameters
notificationId
The id of the notification to mark as read
error
A reference to an error pointer that will be set in the case of an error
-
Mark all notifications as read
Declaration
Objective-C
- (void)readAll:(NSError *_Nullable *_Nullable)error;
Swift
func readAll(_ error: NSErrorPointer)
Parameters
error
A reference to an error pointer that will be set in the case of an error
-
Accept an invite via an invite notification
Declaration
Objective-C
- (nonnull NSString *)acceptInvite:(nonnull NSString *)notificationId error:(NSError *_Nullable *_Nullable)error;
Swift
func acceptInvite(_ notificationId: String, error: NSErrorPointer) -> String
Parameters
notificationId
The id of the invite notification
error
A reference to an error pointer that will be set in the case of an error
Return Value
The hash of the newly created thread join block
-
Ignore an invite via an invite notification
Declaration
Objective-C
- (void)ignoreInvite:(nonnull NSString *)notificationId error:(NSError *_Nullable *_Nullable)error;
Swift
func ignoreInvite(_ notificationId: String, error: NSErrorPointer)
Parameters
notificationId
The id of the invite notification
error
A reference to an error pointer that will be set in the case of an error