ProfileApi

@interface ProfileApi : NodeDependant

Provides access to Textile profile related APIs

  • Get the Peer object associated with the local Textile peer

    Declaration

    Objective-C

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

    Swift

    func get() throws -> Any

    Parameters

    error

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

    Return Value

    The Peer object associated with the local Textile peer

  • Get the user name associated with the local Textile peer

    Declaration

    Objective-C

    - (nonnull NSString *)name:(NSError *_Nullable *_Nullable)error;

    Swift

    func name(_ error: NSErrorPointer) -> String

    Parameters

    error

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

    Return Value

    The user name associated with the local Textile peer

  • Set the user name

    Declaration

    Objective-C

    - (void)setName:(nonnull NSString *)name
              error:(NSError *_Nullable *_Nullable)error;

    Swift

    func setName(_ name: String, error: NSErrorPointer)

    Parameters

    name

    The new user name

    error

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

  • Get the target of the profile avatar

    Declaration

    Objective-C

    - (nonnull NSString *)avatar:(NSError *_Nullable *_Nullable)error;

    Swift

    func avatar(_ error: NSErrorPointer) -> String

    Parameters

    error

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

    Return Value

    The target of the avatar

  • Set the user’s avatar image

    Declaration

    Objective-C

    - (void)setAvatar:(nonnull NSString *)item
           completion:
               (nonnull void (^)(int *_Nullable, NSError *_Nonnull))completion;

    Swift

    func setAvatar(_ item: String, completion: @escaping (UnsafeMutablePointer<Int32>?, Error) -> Void)

    Parameters

    item

    The path to an image or existing hash to set as the avatar

    completion

    A block that will get called with the results of the setAvatar operation

  • Get the Textile account thread

    Declaration

    Objective-C

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

    Swift

    func accountThread() throws -> Any

    Parameters

    error

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

    Return Value

    The account thread