Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

 

...

An alias is a unique, user-specific identifier, set by the application owner (for example, the user's email or an internal system ID number) and is limited to 254 characters.

Aliases have the following uses:

  • The app owner and Appoxee both use the same alias to identify the user.
  • All devices owned by a specific user (an iPhone, an iPad etc.) are identified by the same alias.
  • Aliases are used to create segments of application users, based on user-specific properties (as opposed to application-specific properties).

Note the difference between aliases and tags:

  • Aliases are user-specific, and each user can only have one alias (shared by all the user's devices). 
  • Tags are app-specific, and you can assign multiple tags to the same device. 

The alias API will create an association between a user and a device

Objective-C

Code Block
#pragma mark - Alias

//setDeviceAlias -  Sets the device alias, replacing the current alias value.
- (void)setDeviceAlias:(nullable NSString *)alias withCompletionHandler:(nullable AppoxeeCompletionHandler)handler;
/**
Remove an alias from a device.
@brief Method removes an alias from a device.
@code
[[Appoxee shared] removeDeviceAliasWithCompletionHandler:^(NSError *appoxeeError, id data) {

if (!appoxeeError) {

// Alias was removed.
}
}];
@endcode
An NSString object representing an alias.
@param handler Code Block to be executed when method completes with an NSError object and data as arguments.
*/

 
//removeDeviceAlias - Removes the device alias
- (void)removeDeviceAliasWithCompletionHandler:(nullable AppoxeeCompletionHandler)handler;
/**
Get 
an//getDeviceAlias alias- forReturns athe device. @briefalias Method getsfrom the alias for a device.
@code
[[Appoxee shared] getDeviceAliasWithCompletionHandler:^(NSError *appoxeeError, id data) {

if (!appoxeeError && [data isKindOfClass:[NSString class]]) {

NSString *deviceAlias = (NSString *)data;
}
}];
@endcode
@param handler Code Block to be executed when method completes with an NSError object and data as arguments.
*/
 cache
- (void)getDeviceAliasWithCompletionHandler:(nullable AppoxeeCompletionHandler)handler;
/**
Clear cached value of an alias.
@brief Method clears cached value of an alias.
@code
[[Appoxee shared] clearAliasCacheWithCompletionHandler:^(NSError *appoxeeError, id data) {

if (!appoxeeError) {

// Alias cache was cleared.
}
}];
@endcode
@param handler Code Block to be executed when method completes with an NSError object and data as arguments.
*/
- (void)clearAliasCacheWithCompletionHandler:(nullable AppoxeeCompletionHandler)handler;
#pragma mark - Device Tags
/**

 

Swift

Code Block
#pragma mark - Alias

//setDeviceAlias -  Sets the device alias, replacing the current alias value.
func setDeviceAlias(alias: String?, withCompletionHandler handler: AppoxeeCompletionHandler?)

 
//removeDeviceAlias - Removes the device alias
func removeDeviceAliasWithCompletionHandler(handler: AppoxeeCompletionHandler?)

 
//getDeviceAlias - Returns the device alias from the device cache
func getDeviceAliasWithCompletionHandler(handler: AppoxeeCompletionHandler?)