AVAnonymousUtils Class Reference

Inherits from NSObject
Declared in AVAnonymousUtils.h

Overview

Provides utility functions for working with Anonymously logged-in users. Anonymous users have some unique characteristics:

  • Anonymous users don't need a user name or password.
  • Once logged out, an anonymous user cannot be recovered.
  • When the current user is anonymous, the following methods can be used to switch to a different user or convert the anonymous user into a regular one:
    • signUp converts an anonymous user to a standard user with the given username and password. Data associated with the anonymous user is retained.
    • logIn switches users without converting the anonymous user. Data associated with the anonymous user will be lost.
    • Service logIn (e.g. Facebook, Twitter) will attempt to convert the anonymous user into a standard user by linking it to the service. If a user already exists that is linked to the service, it will instead switch to the existing user.
    • Service linking (e.g. Facebook, Twitter) will convert the anonymous user into a standard user by linking it to the service.

Creating an Anonymous User

+ logInWithBlock:

Creates an anonymous user.

+ (void)logInWithBlock:(AVUserResultBlock)block

Parameters

block

The block to execute when anonymous user creation is complete. The block should have the following argument signature: (AVUser user, NSError error)

Discussion

Creates an anonymous user.

Declared In

AVAnonymousUtils.h

+ logInWithTarget:selector:

Creates an anonymous user. The selector for the callback should look like: (AVUser )user error:(NSError )error

+ (void)logInWithTarget:(id)target selector:(SEL)selector

Parameters

target

Target object for the selector.

selector

The selector that will be called when the asynchronous request is complete.

Discussion

Creates an anonymous user. The selector for the callback should look like: (AVUser )user error:(NSError )error

Declared In

AVAnonymousUtils.h

Determining Whether a AVUser is Anonymous

+ isLinkedWithUser:

Whether the user is logged in anonymously.

+ (BOOL)isLinkedWithUser:(AVUser *)user

Parameters

user

User to check for anonymity. The user must be logged in on this device.

Return Value

True if the user is anonymous. False if the user is not the current user or is not anonymous.

Discussion

Whether the user is logged in anonymously.

Declared In

AVAnonymousUtils.h