ThreadsApi
@interface ThreadsApi : NodeDependant
Provides access to Textile threads related APIs
-
Create a new thread
Declaration
Objective-C
- (id)add:(id)config error:(NSError *_Nullable *_Nullable)error;Swift
func add(_ config: Any!) throws -> AnyParameters
configThe configuration object that describes the thread to be created
errorA reference to an error pointer that will be set in the case of an error
Return Value
The newly created thread
-
Update an existing thread or create it if it doesn’t exist
Declaration
Objective-C
- (void)addOrUpdate:(id)thrd error:(NSError *_Nullable *_Nullable)error;Swift
func addOrUpdate(_ thrd: Any!, error: NSErrorPointer)Parameters
thrdThe updated representation of the thread to update
errorA reference to an error pointer that will be set in the case of an error
-
Rename a thread
Declaration
Objective-C
- (void)rename:(nonnull NSString *)threadId name:(nonnull NSString *)name error:(NSError *_Nullable *_Nullable)error;Swift
func rename(_ threadId: String, name: String, error: NSErrorPointer)Parameters
threadIdThe id of the thread to rename
nameThe new name for the thread
errorA reference to an error pointer that will be set in the case of an error
-
Get an existing thread by id
Declaration
Objective-C
- (id)get:(nonnull NSString *)threadId error:(NSError *_Nullable *_Nullable)error;Swift
func get(_ threadId: String) throws -> AnyParameters
threadIdThe id of the thread to retrieve
errorA reference to an error pointer that will be set in the case of an error
Return Value
The corresponding thread object
-
List all threads the local peer account participates in
Declaration
Objective-C
- (id)list:(NSError *_Nullable *_Nullable)error;Swift
func list() throws -> AnyParameters
errorA reference to an error pointer that will be set in the case of an error
Return Value
An object containing a list of threads
-
List all peers that participate in a particular thread
Declaration
Objective-C
- (id)peers:(nonnull NSString *)threadId error:(NSError *_Nullable *_Nullable)error;Swift
func peers(_ threadId: String) throws -> AnyParameters
threadIdThe id of the thread to query
errorA reference to an error pointer that will be set in the case of an error
Return Value
An object containing a list of contacts
-
Leave a thread
Declaration
Objective-C
- (nonnull NSString *)remove:(nonnull NSString *)threadId error:(NSError *_Nullable *_Nullable)error;Swift
func remove(_ threadId: String, error: NSErrorPointer) -> StringParameters
threadIdThe id of the thread to remove
errorA reference to an error pointer that will be set in the case of an error
Return Value
The hash of the newly created thread leave block
-
Snapshot all threads and sync them to registered cafes
Declaration
Objective-C
- (void)snapshot:(NSError *_Nullable *_Nullable)error;Swift
func snapshot(_ error: NSErrorPointer)Parameters
errorA reference to an error pointer that will be set in the case of an error
-
Searches the network for thread snapshots
Declaration
Objective-C
- (id)searchSnapshots:(id)query options:(id)options error:(NSError *_Nullable *_Nullable)error;Swift
func searchSnapshots(_ query: Any!, options: Any!) throws -> AnyParameters
queryThe object describing the query to execute
optionsOptions controlling the behavior of the search
errorA reference to an error pointer that will be set in the case of an error
Return Value
A handle that can be used to cancel the search
View on GitHub
ThreadsApi Class Reference