Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Ability to set custom fields 

You can add custom strings, numbers and date variables. The information you set on each user can later be used to segment the users and create personalized dynamic push messages.

For example:

  • Add a user's first name to create personal push messages: " Hi John, we are...."
  • Add a user's birthday and use it to create a periodic birthday campaign to congratulate users on their birthday
  • Add a user's level in the game and use it to segment the users according to the level they have reached in your game

 

Objective-C

[[Appoxee shared] setDateValue:[NSDate date] forKey:@"key" withCompletionHandler:^(NSError * _Nullable appoxeeError, id _Nullable data) {

	if (!appoxeeError) {

		// Operation was successful.
	}
}];

[[Appoxee shared] setNumberValue:@(1.01) forKey:@"key" withCompletionHandler:^(NSError * _Nullable appoxeeError, id _Nullable data) {

	if (!appoxeeError) {

		// Operation was successful.
	}
}];

[[Appoxee shared] incrementNumericKey:@"key" byNumericValue:@(1.6) withCompletionHandler:^(NSError * _Nullable appoxeeError, id _Nullable data) {

	if (!appoxeeError) {

		// Operation was successful.
	}
}];

[[Appoxee shared] setStringValue:@"string" forKey:@"key" withCompletionHandler:^(NSError * _Nullable appoxeeError, id _Nullable data) {

	if (!appoxeeError) {

		// Operation was successful.
	}
}];

[[Appoxee shared] fetchCustomFieldByKey:@"CustomFieldKey" withCompletionHandler:^(NSError *appoxeeError, id data) {

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

		NSDictionary *dictionary = (NSDictionary *)data;
		NSString *key = [[dictionary allKeys] firstObject];
		id value = dictionary[key]; // can be of the following types: NSString || NSNumber || NSDate
	}

	// If there wan't an error, and data object is nil, then value doesn't exist on the device.
}];

 

Swift

 
  • No labels