InvitesApi

@interface InvitesApi : NodeDependant

Provides access to Textile invites related APIs

  • Invite a contact to a thread

    Declaration

    Objective-C

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

    Swift

    func add(_ threadId: String, address: String, error: NSErrorPointer)

    Parameters

    threadId

    The id of the thread to invite to

    address

    The address of the contact to invite

    error

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

  • Create an external invite, one for someone who isn’t in Textile yet

    Declaration

    Objective-C

    - (id)addExternal:(nonnull NSString *)threadId
                error:(NSError *_Nullable *_Nullable)error;

    Swift

    func addExternal(_ threadId: String) throws -> Any

    Parameters

    threadId

    The id of the thread to invite to

    error

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

    Return Value

    An object representing the external invite

  • View a list of pending incoming invites

    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 pending invites

  • Accept an invite

    Declaration

    Objective-C

    - (nonnull NSString *)accept:(nonnull NSString *)inviteId
                           error:(NSError *_Nullable *_Nullable)error;

    Swift

    func accept(_ inviteId: String, error: NSErrorPointer) -> String

    Parameters

    inviteId

    The id of the invite to accept

    error

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

    Return Value

    The hash of the new thread join block

  • Accept an external invite

    Declaration

    Objective-C

    - (nonnull NSString *)acceptExternal:(nonnull NSString *)inviteId
                                     key:(nonnull NSString *)key
                                   error:(NSError *_Nullable *_Nullable)error;

    Swift

    func acceptExternal(_ inviteId: String, key: String, error: NSErrorPointer) -> String

    Parameters

    inviteId

    The id of the external invite to accept

    key

    The key associated with the external invite to accept

    error

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

    Return Value

    The hash of the new thread join block

  • Ignore an invite

    Declaration

    Objective-C

    - (void)ignore:(nonnull NSString *)inviteId
             error:(NSError *_Nullable *_Nullable)error;

    Swift

    func ignore(_ inviteId: String, error: NSErrorPointer)

    Parameters

    inviteId

    The id of the invite to ignore

    error

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