UAUser

@interface UAUser : UAComponent

Primary interface for working with the application’s associated Airship user.

  • Gets the data associated with the user.

    Declaration

    Objective-C

    - (void)getUserData:(nonnull void (^)(UAUserData *_Nullable))completionHandler
                  queue:(nullable dispatch_queue_t)queue;

    Swift

    func getData(_ completionHandler: @escaping (UAUserData?) -> Void, queue: DispatchQueue?)

    Parameters

    completionHandler

    A completion handler which will be called with the user data.

    queue

    The queue on which to invoke the completion handler.

  • Gets the data associated with the user.

    Declaration

    Objective-C

    - (void)getUserData:(nonnull void (^)(UAUserData *_Nonnull))completionHandler;

    Swift

    func getData(_ completionHandler: @escaping (UAUserData) -> Void)

    Parameters

    completionHandler

    A completion handler which will be called with the user data.

  • Gets the data associated with the user, synchronously.

    Note: This method may block the calling thread, and thus should be avoided while working on the main queue.

    Declaration

    Objective-C

    - (nullable UAUserData *)getUserDataSync;

    Swift

    func getDataSync() -> UAUserData?

    Return Value

    The user data, or nil if no data is available.