ContactsApi

@interface ContactsApi : NodeDependant

Provides access to Textile contacts related APIs

  • Add a new Contact to the account’s list of Contacts

    Declaration

    Objective-C

    - (void)add:(id)contact error:(NSError *_Nullable *_Nullable)error;

    Swift

    func add(_ contact: Any!, error: NSErrorPointer)

    Parameters

    contact

    The new contact to add, usually returned from a Contact search

    error

    A reference to an error pointer that will be set in the case of an error

  • Get a Contact by address from list of existing Contacts

    Declaration

    Objective-C

    - (id)get:(nonnull NSString *)address
        error:(NSError *_Nullable *_Nullable)error;

    Swift

    func get(_ address: String) throws -> Any

    Parameters

    address

    The address of the Contact to retrieve

    error

    A reference to an error pointer that will be set in the case of an error

    Return Value

    The Contact object corresponding to the address

  • List all existing account Contacts

    Declaration

    Objective-C

    - (id)list:(NSError *_Nullable *_Nullable)error;

    Swift

    func list() throws -> Any

    Parameters

    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 all account contacts

  • Remove a Contact from the account by address

    Declaration

    Objective-C

    - (void)remove:(nonnull NSString *)address
             error:(NSError *_Nullable *_Nullable)error;

    Swift

    func remove(_ address: String, error: NSErrorPointer)

    Parameters

    address

    The address of the contact to remove

    error

    A reference to an error pointer that will be set in the case of an error

  • List all threads a particular contact and the local node account participate in

    Declaration

    Objective-C

    - (id)threads:(nonnull NSString *)address
            error:(NSError *_Nullable *_Nullable)error;

    Swift

    func threads(_ address: String) throws -> Any

    Parameters

    address

    The contact address to find threads for

    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 all threads the contact and the local node account participate in

  • Search for Textile Contacts across the entire network

    Declaration

    Objective-C

    - (id)search:(id)query
         options:(id)options
           error:(NSError *_Nullable *_Nullable)error;

    Swift

    func search(_ query: Any!, options: Any!) throws -> Any

    Parameters

    query

    A query object describing the search to execute

    options

    A query options object to control the behavior of the search

    error

    A 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