API reference
This document lists information about the previous versions of the Adobe Experience Platform Mobile SDKs. Check out this page for latest versions and solution support of the Mobile SDKs.
extensionVersion
The extensionVersion()
API returns the version of the Profile extension.
Swift
Syntax
Copied to your clipboardstatic var extensionVersion: String
Example
Copied to your clipboardlet extensionVersion = ACPUserProfile.extensionVersion()
Objective-C
Syntax
Copied to your clipboard+ (nonnull NSString*) extensionVersion;
Example
Copied to your clipboardNSString *extensionVersion = [ACPUserProfile extensionVersion];
Java
Syntax
Copied to your clipboardpublic static String extensionVersion()
Example
Copied to your clipboardString extensionVersion = UserProfile.extensionVersion();
Swift
Syntax
Copied to your clipboardstatic var extensionVersion: String
Example
Copied to your clipboardlet extensionVersion = ACPUserProfile.extensionVersion()
Objective-C
Syntax
Copied to your clipboard+ (nonnull NSString*) extensionVersion;
Example
Copied to your clipboardNSString *extensionVersion = [ACPUserProfile extensionVersion];
JavaScript
Copied to your clipboardACPUserProfile.extensionVersion().then(extensionVersion => console.log("AdobeExperienceSDK: ACPUserProfile version: " + extensionVersion));
getUserAttributes
The getUserAttributes()
API gets the user profile attributes with the given keys.
Java
Syntax
Copied to your clipboardpublic static void getUserAttributes(List<String> keys, AdobeCallback<Map<String, Object>> callback)
- callback is invoked after the customer attributes are available.
Example
A retail application wants to get the itemsAddedToCart
user data when processing checkout.
When AdobeCallbackWithError
is provided, if the operation times out (5s) or an unexpected error occurs, the fail
method is called with the appropriate AdobeError
.
Copied to your clipboardUserProfile.getUserAttributes(Arrays.asList("itemsAddedToCart"), new AdobeCallbackWithError<Map<String, Object>>() {@Overridepublic void fail(AdobeError adobeError) {// your customized code}@Overridepublic void call(Map<String, Object> stringObjectMap) {// your customized code}});
Swift
Syntax
Copied to your clipboardstatic func getUserAttributes(_ attributeNames: [String]?, withCompletionHandler completionHandler:([AnyHashable : Any]?, Error?) -> Void)
- completionHandler is invoked after the customer attributes are available, or error if an unexpected error occurs or the request times out. The default timeout is 5s.
Example
A retail application wants to get the itemsAddedToCart
user data when processing checkout.
Copied to your clipboardACPUserProfile.getUserAttributes(["itemsAddedToCart"], withCompletionHandler: {(dict: [AnyHashable: Any]?, error: Error?) -> Void in// your customized code})
Objective-C
Syntax
Copied to your clipboard+ (void) getUserAttributes: (nullable NSArray <NSString*>*) attributNames withCompletionHandler: (nonnull void (^) (NSDictionary* __nullable userAttributes, NSError* _Nullable error)) completionHandler
Example
Copied to your clipboard[ACPUserProfile getUserAttributes:attributes withCompletionHandler:^(NSDictionary* dict, NSError* error){// your customized code}];
Dart
Syntax
Copied to your clipboardstatic Future<String> getUserAttributes(List<String> attributeKeys) async
- attributeKeys is an array of strings containing the names of user profile attributes to retrieve.
Example
A retail application wants to get the itemsAddedToCart
user data when processing checkout.
Copied to your clipboardtry {result = await FlutterACPUserProfile.getUserAttributes(["itemsAddedToCart"]);} on PlatformException {log("Failed to get the user attributes");}
Cordova
Syntax
Copied to your clipboardACPUserProfile.getUserAttributes = function(attributeNames, success, fail);
- attributeNames is an array of strings containing the names of user profile attributes to retrieve.
- success is a callback containing the retrieved user profile attributes.
- fail is a callback containing error information if the getUserAttributes API was executed with errors.
Example
A retail application wants to get the itemsAddedToCart
user data when processing checkout.
Copied to your clipboardvar attributeNames = new Array();attributeNames.push("itemsAddedToCart");ACPUserProfile.getUserAttributes(attributeNames, handleCallback, handleError);
Syntax
Android
Copied to your clipboardpublic unsafe static void GetUserAttributes (IList<string> keys, IAdobeCallback callback);
- keys is an IList containing the names of user profile attributes to retrieve.
iOS
Copied to your clipboardpublic unsafe static void GetUserAttributes (string[] attributNames, [BlockProxy (typeof(ObjCRuntime.Trampolines.NIDActionArity2V0))] Action<NSDictionary, NSError> completionHandler);
- attributNames is an array of strings containing the names of user profile attributes to remove.
Example
A retail application wants to get the itemsAddedToCart
user data when processing checkout.
Android
Copied to your clipboardvar keysToRetrieve = new List<string>();keysToRetrieve.Add("itemsAddedToCart");ACPUserProfile.GetUserAttributes(keysToRetrieve, new AdobeCallback());class AdobeCallback : Java.Lang.Object, IAdobeCallbackWithError{public void Fail(AdobeError error){Console.WriteLine("GetUserAttributes error: " + error.ToString());}public void Call(Java.Lang.Object retrievedAttributes){if (retrievedAttributes != null){var attributesDictionary = new Android.Runtime.JavaDictionary<string, object>(retrievedAttributes.Handle, Android.Runtime.JniHandleOwnership.DoNotRegister);foreach (KeyValuePair<string, object> pair in attributesDictionary){Console.WriteLine("[ " + pair.Key + " : " + pair.Value + " ]");}}else{Console.WriteLine("GetUserAttributes callback is null.");}}}
iOS
Copied to your clipboardvar callback = new Action<NSDictionary, NSError>(handleCallback);var keysToRetrieve = new string[] { "itemsAddedToCart" };ACPUserProfile.GetUserAttributes(keysToRetrieve, callback);private void handleCallback(NSDictionary content, NSError error){if (error != null){Console.WriteLine("GetUserAttributes error: " + error.DebugDescription);}else if (content == null){Console.WriteLine("GetUserAttributes callback is null.");}else{var attributesDictionary = (NSDictionary)content;foreach (KeyValuePair<NSObject, NSObject> pair in attributesDictionary){Console.WriteLine("[ " + pair.Key + " : " + pair.Value + " ]");}}}
Java
Syntax
Copied to your clipboardpublic static void getUserAttributes(List<String> keys, AdobeCallback<Map<String, Object>> callback)
- callback is invoked after the customer attributes are available.
Example
A retail application wants to get the itemsAddedToCart
user data when processing checkout.
When AdobeCallbackWithError
is provided, if the operation times out (5s) or an unexpected error occurs, the fail
method is called with the appropriate AdobeError
.
Copied to your clipboardUserProfile.getUserAttributes(Arrays.asList("itemsAddedToCart"), new AdobeCallbackWithError<Map<String, Object>>() {@Overridepublic void fail(AdobeError adobeError) {// your customized code}@Overridepublic void call(Map<String, Object> stringObjectMap) {// your customized code}});
Swift
Syntax
Copied to your clipboardstatic func getUserAttributes(_ attributeNames: [String]?, withCompletionHandler completionHandler:([AnyHashable : Any]?, Error?) -> Void)
- completionHandler is invoked after the customer attributes are available, or error if an unexpected error occurs or the request times out. The default timeout is 5s.
Example
A retail application wants to get the itemsAddedToCart
user data when processing checkout.
Copied to your clipboardACPUserProfile.getUserAttributes(["itemsAddedToCart"], withCompletionHandler: {(dict: [AnyHashable: Any]?, error: Error?) -> Void in// your customized code})
Objective-C
Syntax
Copied to your clipboard+ (void) getUserAttributes: (nullable NSArray <NSString*>*) attributNames withCompletionHandler: (nonnull void (^) (NSDictionary* __nullable userAttributes, NSError* _Nullable error)) completionHandler
Example
Copied to your clipboard[ACPUserProfile getUserAttributes:attributes withCompletionHandler:^(NSDictionary* dict, NSError* error){// your customized code}];
Dart
Syntax
Copied to your clipboardstatic Future<String> getUserAttributes(List<String> attributeKeys) async
- attributeKeys is an array of strings containing the names of user profile attributes to retrieve.
Example
A retail application wants to get the itemsAddedToCart
user data when processing checkout.
Copied to your clipboardtry {result = await FlutterACPUserProfile.getUserAttributes(["itemsAddedToCart"]);} on PlatformException {log("Failed to get the user attributes");}
Cordova
Syntax
Copied to your clipboardACPUserProfile.getUserAttributes = function(attributeNames, success, fail);
- attributeNames is an array of strings containing the names of user profile attributes to retrieve.
- success is a callback containing the retrieved user profile attributes.
- fail is a callback containing error information if the getUserAttributes API was executed with errors.
Example
A retail application wants to get the itemsAddedToCart
user data when processing checkout.
Copied to your clipboardvar attributeNames = new Array();attributeNames.push("itemsAddedToCart");ACPUserProfile.getUserAttributes(attributeNames, handleCallback, handleError);
Syntax
Android
Copied to your clipboardpublic unsafe static void GetUserAttributes (IList<string> keys, IAdobeCallback callback);
- keys is an IList containing the names of user profile attributes to retrieve.
iOS
Copied to your clipboardpublic unsafe static void GetUserAttributes (string[] attributNames, [BlockProxy (typeof(ObjCRuntime.Trampolines.NIDActionArity2V0))] Action<NSDictionary, NSError> completionHandler);
- attributNames is an array of strings containing the names of user profile attributes to remove.
Example
A retail application wants to get the itemsAddedToCart
user data when processing checkout.
Android
Copied to your clipboardvar keysToRetrieve = new List<string>();keysToRetrieve.Add("itemsAddedToCart");ACPUserProfile.GetUserAttributes(keysToRetrieve, new AdobeCallback());class AdobeCallback : Java.Lang.Object, IAdobeCallbackWithError{public void Fail(AdobeError error){Console.WriteLine("GetUserAttributes error: " + error.ToString());}public void Call(Java.Lang.Object retrievedAttributes){if (retrievedAttributes != null){var attributesDictionary = new Android.Runtime.JavaDictionary<string, object>(retrievedAttributes.Handle, Android.Runtime.JniHandleOwnership.DoNotRegister);foreach (KeyValuePair<string, object> pair in attributesDictionary){Console.WriteLine("[ " + pair.Key + " : " + pair.Value + " ]");}}else{Console.WriteLine("GetUserAttributes callback is null.");}}}
iOS
Copied to your clipboardvar callback = new Action<NSDictionary, NSError>(handleCallback);var keysToRetrieve = new string[] { "itemsAddedToCart" };ACPUserProfile.GetUserAttributes(keysToRetrieve, callback);private void handleCallback(NSDictionary content, NSError error){if (error != null){Console.WriteLine("GetUserAttributes error: " + error.DebugDescription);}else if (content == null){Console.WriteLine("GetUserAttributes callback is null.");}else{var attributesDictionary = (NSDictionary)content;foreach (KeyValuePair<NSObject, NSObject> pair in attributesDictionary){Console.WriteLine("[ " + pair.Key + " : " + pair.Value + " ]");}}}
registerExtension
Registers the Profile extension with the Mobile Core extension.
Register the Identity extension in your app's didFinishLaunchingWithOptions
function:
Swift
Syntax
Copied to your clipboardstatic func registerExtensions()
Example
Copied to your clipboardfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {ACPUserProfile.registerExtension()// Override point for customization after application launch.return true;}
Objective-C
Syntax
Copied to your clipboard+ (void) registerExtension;
Example
Copied to your clipboard- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {[ACPUserProfile registerExtension];// Override point for customization after application launch.return YES;}
Java
Syntax
Copied to your clipboardpublic static void registerExtension()
Example
Copied to your clipboardimport com.adobe.marketing.mobile.UserProfile...UserProfile.registerExtension();
Register the Identity extension in your app's didFinishLaunchingWithOptions
function:
Swift
Syntax
Copied to your clipboardstatic func registerExtensions()
Example
Copied to your clipboardfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {ACPUserProfile.registerExtension()// Override point for customization after application launch.return true;}
Objective-C
Syntax
Copied to your clipboard+ (void) registerExtension;
Example
Copied to your clipboard- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {[ACPUserProfile registerExtension];// Override point for customization after application launch.return YES;}
removeUserAttribute
Removes the user profile attribute for the given key.
Swift
Syntax
Copied to your clipboardstatic func removeUserAttribute(_ attributeName: String)
Example
A retail application wants to remove the itemsAddedToCart
user data after the product is purchased.
Copied to your clipboardACPUserProfile.removeUserAttribute("itemsAddedToCart");
Objective-C
Syntax
Copied to your clipboard+ (void) removeUserAttribute: (nonnull NSString*) key
Example
Copied to your clipboard[ACPUserProfile removeUserAttribute:@"itemsAddedToCart"];
Dart
Syntax
Copied to your clipboardstatic Future<void> removeUserAttribute(String attributeName) async
- attributeName is a string containing the name of the user profile attribute to remove.
Example
A retail application wants to remove the itemsAddedToCart
user data after the product is purchased.
Copied to your clipboardFlutterACPUserProfile.removeUserAttribute("itemsAddedToCart");
Cordova
Syntax
Copied to your clipboardACPUserProfile.removeUserAttribute = function(attributeName, success, fail);
- attributeName is a string containing the name of the user profile attribute to remove.
- success is a callback containing a general success message if the removeUserAttribute API executed without any errors.
- fail is a callback containing error information if the removeUserAttribute API was executed with errors.
Example
A retail application wants to remove the itemsAddedToCart
user data after the product is purchased.
Copied to your clipboardACPUserProfile.removeUserAttribute("itemsAddedToCart", handleCallback, handleError);
C#
Syntax
Android
Copied to your clipboardpublic unsafe static void RemoveUserAttribute (string attributeName);
- attributeName is a string containing the name of the user profile attribute to remove.
iOS
Copied to your clipboardpublic static void RemoveUserAttribute (string attributeName);
- attributeName is a string containing the name of the user profile attribute to remove.
Example
A retail application wants to remove the itemsAddedToCart
user data after the product is purchased.
Copied to your clipboardACPUserProfile.RemoveUserAttribute("itemsAddedToCart");
Java
Syntax
Copied to your clipboardpublic static void removeUserAttribute(String attributeName)
Example
A retail application wants to remove the itemsAddedToCart
user data after the product is purchased.
Copied to your clipboardUserProfile.removeUserAttribute("itemsAddedToCart");
Swift
Syntax
Copied to your clipboardstatic func removeUserAttribute(_ attributeName: String)
Example
A retail application wants to remove the itemsAddedToCart
user data after the product is purchased.
Copied to your clipboardACPUserProfile.removeUserAttribute("itemsAddedToCart");
Objective-C
Syntax
Copied to your clipboard+ (void) removeUserAttribute: (nonnull NSString*) key
Example
Copied to your clipboard[ACPUserProfile removeUserAttribute:@"itemsAddedToCart"];
Dart
Syntax
Copied to your clipboardstatic Future<void> removeUserAttribute(String attributeName) async
- attributeName is a string containing the name of the user profile attribute to remove.
Example
A retail application wants to remove the itemsAddedToCart
user data after the product is purchased.
Copied to your clipboardFlutterACPUserProfile.removeUserAttribute("itemsAddedToCart");
Cordova
Syntax
Copied to your clipboardACPUserProfile.removeUserAttribute = function(attributeName, success, fail);
- attributeName is a string containing the name of the user profile attribute to remove.
- success is a callback containing a general success message if the removeUserAttribute API executed without any errors.
- fail is a callback containing error information if the removeUserAttribute API was executed with errors.
Example
A retail application wants to remove the itemsAddedToCart
user data after the product is purchased.
Copied to your clipboardACPUserProfile.removeUserAttribute("itemsAddedToCart", handleCallback, handleError);
C#
Syntax
Android
Copied to your clipboardpublic unsafe static void RemoveUserAttribute (string attributeName);
- attributeName is a string containing the name of the user profile attribute to remove.
iOS
Copied to your clipboardpublic static void RemoveUserAttribute (string attributeName);
- attributeName is a string containing the name of the user profile attribute to remove.
Example
A retail application wants to remove the itemsAddedToCart
user data after the product is purchased.
Copied to your clipboardACPUserProfile.RemoveUserAttribute("itemsAddedToCart");
removeUserAttributes
Removes the user profile attributes for the given keys.
Swift
Syntax
Copied to your clipboardstatic func removeUserAttributes(_ attributeNames: [String]?)
Example
You want to remove username
, usertype
user data when session timeout occurs.
Copied to your clipboardACPUserProfile.removeUserAttributes(["username","usertype"]);
Objective-C
Syntax
Copied to your clipboard+ (void) removeUserAttributes: (nonnull NSArray <NSString*>*) attributeNames
Example
Copied to your clipboard[ACPUserProfile removeUserAttributes:@[@"username", @"usertype"]]
Dart
Syntax
Copied to your clipboardstatic Future<void> removeUserAttributes(List<String> attributeName) async
- attributeName is an array of strings containing the names of user profile attributes to remove.
Example
You want to remove username
, usertype
user data when session timeout occurs.
Copied to your clipboardFlutterACPUserProfile.removeUserAttributes(["username", "usertype"])
Cordova
Syntax
Copied to your clipboardACPUserProfile.removeUserAttributes = function(attributeNames, success, fail);
- attributeNames is an array of strings containing the names of user profile attributes to remove.
- success is a callback containing a general success message if the removeUserAttributes API executed without any errors.
- fail is a callback containing error information if the removeUserAttributes API was executed with errors.
Example
You want to remove username
, usertype
user data when session timeout occurs.
Copied to your clipboardvar attributeNames = new Array();attributeNames.push("username");attributeNames.push("usertype");ACPUserProfile.removeUserAttributes(attributeNames, handleCallback, handleError);
C#
Syntax
Android
Copied to your clipboardpublic unsafe static void RemoveUserAttributes (IList<string> attributeNames);
- attributeNames is an IList containing the names of user profile attributes to remove.
iOS
Copied to your clipboardpublic static void RemoveUserAttributes (string[] attributeNames);
- attributeNames is an array of strings containing the names of user profile attributes to remove.
Example
You want to remove username
, usertype
user data when session timeout occurs.
Android
Copied to your clipboardvar attributes = new List<string>();attributes.Add("username");attributes.Add("usertype");ACPUserProfile.RemoveUserAttributes(attributes);
iOS
Copied to your clipboardstring[] attributes = new string[] { "username", "usertype" };ACPUserProfile.RemoveUserAttributes(attributes);
Java
Syntax
Copied to your clipboardpublic static void removeUserAttributes(List<String> attributeNames)
Example
You want to remove username
, usertype
user data when session timeout occurs.
Copied to your clipboardUserProfile.removeUserAttributes(Arrays.asList("username", "usertype"));
Swift
Syntax
Copied to your clipboardstatic func removeUserAttributes(_ attributeNames: [String]?)
Example
You want to remove username
, usertype
user data when session timeout occurs.
Copied to your clipboardACPUserProfile.removeUserAttributes(["username","usertype"]);
Objective-C
Syntax
Copied to your clipboard+ (void) removeUserAttributes: (nonnull NSArray <NSString*>*) attributeNames
Example
Copied to your clipboard[ACPUserProfile removeUserAttributes:@[@"username", @"usertype"]]
Dart
Syntax
Copied to your clipboardstatic Future<void> removeUserAttributes(List<String> attributeName) async
- attributeName is an array of strings containing the names of user profile attributes to remove.
Example
You want to remove username
, usertype
user data when session timeout occurs.
Copied to your clipboardFlutterACPUserProfile.removeUserAttributes(["username", "usertype"])
Cordova
Syntax
Copied to your clipboardACPUserProfile.removeUserAttributes = function(attributeNames, success, fail);
- attributeNames is an array of strings containing the names of user profile attributes to remove.
- success is a callback containing a general success message if the removeUserAttributes API executed without any errors.
- fail is a callback containing error information if the removeUserAttributes API was executed with errors.
Example
You want to remove username
, usertype
user data when session timeout occurs.
Copied to your clipboardvar attributeNames = new Array();attributeNames.push("username");attributeNames.push("usertype");ACPUserProfile.removeUserAttributes(attributeNames, handleCallback, handleError);
C#
Syntax
Android
Copied to your clipboardpublic unsafe static void RemoveUserAttributes (IList<string> attributeNames);
- attributeNames is an IList containing the names of user profile attributes to remove.
iOS
Copied to your clipboardpublic static void RemoveUserAttributes (string[] attributeNames);
- attributeNames is an array of strings containing the names of user profile attributes to remove.
Example
You want to remove username
, usertype
user data when session timeout occurs.
Android
Copied to your clipboardvar attributes = new List<string>();attributes.Add("username");attributes.Add("usertype");ACPUserProfile.RemoveUserAttributes(attributes);
iOS
Copied to your clipboardstring[] attributes = new string[] { "username", "usertype" };ACPUserProfile.RemoveUserAttributes(attributes);
updateUserAttribute
Sets the user profile attributes key and value and allows you to create or update a user profile attribute.
Remember the following information:
- If the attribute does not exist, it will be created.
- If the attribute exists, the value will be updated.
- A null attribute value removes the attribute.
Swift
Syntax
Copied to your clipboardstatic func updateUserAttribute(_ attributeName: String, withValue attributeValue: String?)
Example
You want to update username
of a user obtained in the log in page:
Copied to your clipboardACPUserProfile.updateUserAttribute("username", withValue: "Will Smith");
Objective-C
Syntax
Copied to your clipboard+ (void) updateUserAttribute: (nonnull NSString*) attributeName withValue: (nullable NSString*) attributeValue;
Example
Copied to your clipboard[ACPUserProfile updateUserAttribute:@"username" withValue:@"Will Smith"];
Dart
Syntax
Copied to your clipboardstatic Future<void> updateUserAttribute(String attributeName, String attributeValue) async
- attributeName is a string containing the name of the user profile attribute to create or update.
- attributeValue must be a string, number, or array containing the user profile attribute value.
Example
You want to update username
of a user obtained in the log in page :
Copied to your clipboardFlutterACPUserProfile.updateUserAttribute("username", "Will Smith");
Cordova
Syntax
Copied to your clipboardACPUserProfile.updateUserAttribute = function(attributeName, attributeValue, success, fail);
- attributeName is a string containing the name of the user profile attribute to create or update.
- attributeValue must be a string, number, or array containing the user profile attribute value.
- success is a callback containing a general success message if the updateUserAttribute API executed without any errors.
- fail is a callback containing error information if the updateUserAttribute API was executed with errors.
Example
You want to update username
of a user obtained in the log in page:
Copied to your clipboardACPUserProfile.updateUserAttribute("username", "Will Smith", handleCallback, handleError);
C#
Syntax
Android
Copied to your clipboardpublic unsafe static void UpdateUserAttribute (string attributeName, Java.Lang.Object attributeValue);
- attributeName is a string containing the name of the user profile attribute to create or update.
- attributeValue must be a String, Integer, Boolean, Double, Array, or Map containing the user profile attribute value. Custom objects cannot be saved as a
UserProfile
attribute.
iOS
Copied to your clipboardpublic static void UpdateUserAttribute (string attributeName, string attributeValue);
- attributeName is a string containing the name of the user profile attribute to create or update.
- attributeValue is a string containing the user profile attribute value.
Example
You want to update username
of a user obtained in the log in page:
Copied to your clipboardACPUserProfile.updateUserAttribute("username", "Will Smith");
Java
Syntax
Copied to your clipboardpublic static void updateUserAttribute(String attributeName,Object attributeValue)
Example
You want to update username
of a user obtained in the log in page:
Copied to your clipboardUserProfile.updateUserAttribute("username", "Will Smith");
Swift
Syntax
Copied to your clipboardstatic func updateUserAttribute(_ attributeName: String, withValue attributeValue: String?)
Example
You want to update username
of a user obtained in the log in page:
Copied to your clipboardACPUserProfile.updateUserAttribute("username", withValue: "Will Smith");
Objective-C
Syntax
Copied to your clipboard+ (void) updateUserAttribute: (nonnull NSString*) attributeName withValue: (nullable NSString*) attributeValue;
Example
Copied to your clipboard[ACPUserProfile updateUserAttribute:@"username" withValue:@"Will Smith"];
Dart
Syntax
Copied to your clipboardstatic Future<void> updateUserAttribute(String attributeName, String attributeValue) async
- attributeName is a string containing the name of the user profile attribute to create or update.
- attributeValue must be a string, number, or array containing the user profile attribute value.
Example
You want to update username
of a user obtained in the log in page :
Copied to your clipboardFlutterACPUserProfile.updateUserAttribute("username", "Will Smith");
Cordova
Syntax
Copied to your clipboardACPUserProfile.updateUserAttribute = function(attributeName, attributeValue, success, fail);
- attributeName is a string containing the name of the user profile attribute to create or update.
- attributeValue must be a string, number, or array containing the user profile attribute value.
- success is a callback containing a general success message if the updateUserAttribute API executed without any errors.
- fail is a callback containing error information if the updateUserAttribute API was executed with errors.
Example
You want to update username
of a user obtained in the log in page:
Copied to your clipboardACPUserProfile.updateUserAttribute("username", "Will Smith", handleCallback, handleError);
C#
Syntax
Android
Copied to your clipboardpublic unsafe static void UpdateUserAttribute (string attributeName, Java.Lang.Object attributeValue);
- attributeName is a string containing the name of the user profile attribute to create or update.
- attributeValue must be a String, Integer, Boolean, Double, Array, or Map containing the user profile attribute value. Custom objects cannot be saved as a
UserProfile
attribute.
iOS
Copied to your clipboardpublic static void UpdateUserAttribute (string attributeName, string attributeValue);
- attributeName is a string containing the name of the user profile attribute to create or update.
- attributeValue is a string containing the user profile attribute value.
Example
You want to update username
of a user obtained in the log in page:
Copied to your clipboardACPUserProfile.updateUserAttribute("username", "Will Smith");
updateUserAttributes
Sets the user profile attributes key and value.
Allows you to create/update a batch of user profile attributes:
- String, Integer, Boolean, Double, Array, Map are valid type of user profile attributes.
- Custom objects cannot be saved as a
UserProfile
attribute. - If the attribute does not exist, it is created.
- If the attribute already exists, the value is updated.
- A null attribute value will remove the attribute.
Java
Syntax
Copied to your clipboardpublic static void updateUserAttributes(Map<String, Object> attributeMap)
Example
You want to update username, usertype
of a user obtained in the log in page:
Copied to your clipboardHashMap<String, Object> profileMap = new HashMap<>();profileMap.put("username","Will Smith");profileMap.put("usertype","Actor");UserProfile.updateUserAttributes(profileMap);
Swift
Syntax
Copied to your clipboardstatic func updateUserAttributes(_ attributeMap: [AnyHashble: Any])
Example
You want to update username, usertype
of a user obtained in the log in page:
Copied to your clipboardvar profileMap = [AnyHashable: Any]()profileMap["username"] = "will_smith"profileMap["usertype"] = "Actor"ACPUserProfile.updateUserAttributes(profileMap)
Objective-C
Syntax
Copied to your clipboard+ (void) updateUserAttributes: (nonnull NSDictionary*) attributeMap
Example
Copied to your clipboardNSMutableDictionary *profileMap = [NSMutableDictionary dictionary];[profileMap setObject:@"username" forKey:@"will_smith"];[profileMap setObject:@"usertype" forKey:@"Actor"];[ACPUserProfile updateUserAttributes:profileMap];
Dart
Syntax
Copied to your clipboardstatic Future<void> updateUserAttributes(Map<String, Object> attributeMap) async
- attributeMap is a object containing a batch of user profile attributes to create or update.
Example
You want to update username, usertype
of a user obtained in the log in page:
Copied to your clipboardFlutterACPUserProfile.updateUserAttributes({"username":"will_smith", "usertype":"Actor"});
Cordova
Syntax
Copied to your clipboardACPUserProfile.updateUserAttributes = function(attributes, success, fail);
- attributes is a object containing a batch of user profile attributes to create or update.
- success is a callback containing a general success message if the updateUserAttributes API executed without any errors.
- fail is a callback containing error information if the updateUserAttributes API was executed with errors.
Example
You want to update username, usertype
of a user obtained in the log in page:
Copied to your clipboardvar username = "will_smith";var usertype = "Actor";var attributes = {"username":username, "usertype":usertype};ACPUserProfile.updateUserAttributes(attributes, handleCallback, handleError);
C#
Syntax
Android
Copied to your clipboardpublic unsafe static void UpdateUserAttributes (IDictionary<string, Java.Lang.Object> attributeMap);
- attributeMap is a object containing a batch of user profile attributes to create or update.
iOS
Copied to your clipboardpublic static void UpdateUserAttributes (NSDictionary attributeMap);
- attributeMap is a object containing a batch of user profile attributes to create or update.
Example
You want to update username, usertype
of a user obtained in the log in page :
Android
Copied to your clipboardvar attributes = new Dictionary<string, Java.Lang.Object>();attributes.Add("username", "will_smith");attributes.Add("usertype", "Actor");ACPUserProfile.UpdateUserAttributes(attributes);
iOS
Copied to your clipboardvar attributes = new NSMutableDictionary<NSString, NSString>{["username"] = new NSString("will_smith"),["usertype"] = new NSString("Actor")};ACPUserProfile.updateUserAttributes(attributes);
Java
Syntax
Copied to your clipboardpublic static void updateUserAttributes(Map<String, Object> attributeMap)
Example
You want to update username, usertype
of a user obtained in the log in page:
Copied to your clipboardHashMap<String, Object> profileMap = new HashMap<>();profileMap.put("username","Will Smith");profileMap.put("usertype","Actor");UserProfile.updateUserAttributes(profileMap);
Swift
Syntax
Copied to your clipboardstatic func updateUserAttributes(_ attributeMap: [AnyHashble: Any])
Example
You want to update username, usertype
of a user obtained in the log in page:
Copied to your clipboardvar profileMap = [AnyHashable: Any]()profileMap["username"] = "will_smith"profileMap["usertype"] = "Actor"ACPUserProfile.updateUserAttributes(profileMap)
Objective-C
Syntax
Copied to your clipboard+ (void) updateUserAttributes: (nonnull NSDictionary*) attributeMap
Example
Copied to your clipboardNSMutableDictionary *profileMap = [NSMutableDictionary dictionary];[profileMap setObject:@"username" forKey:@"will_smith"];[profileMap setObject:@"usertype" forKey:@"Actor"];[ACPUserProfile updateUserAttributes:profileMap];
Dart
Syntax
Copied to your clipboardstatic Future<void> updateUserAttributes(Map<String, Object> attributeMap) async
- attributeMap is a object containing a batch of user profile attributes to create or update.
Example
You want to update username, usertype
of a user obtained in the log in page:
Copied to your clipboardFlutterACPUserProfile.updateUserAttributes({"username":"will_smith", "usertype":"Actor"});
Cordova
Syntax
Copied to your clipboardACPUserProfile.updateUserAttributes = function(attributes, success, fail);
- attributes is a object containing a batch of user profile attributes to create or update.
- success is a callback containing a general success message if the updateUserAttributes API executed without any errors.
- fail is a callback containing error information if the updateUserAttributes API was executed with errors.
Example
You want to update username, usertype
of a user obtained in the log in page:
Copied to your clipboardvar username = "will_smith";var usertype = "Actor";var attributes = {"username":username, "usertype":usertype};ACPUserProfile.updateUserAttributes(attributes, handleCallback, handleError);
C#
Syntax
Android
Copied to your clipboardpublic unsafe static void UpdateUserAttributes (IDictionary<string, Java.Lang.Object> attributeMap);
- attributeMap is a object containing a batch of user profile attributes to create or update.
iOS
Copied to your clipboardpublic static void UpdateUserAttributes (NSDictionary attributeMap);
- attributeMap is a object containing a batch of user profile attributes to create or update.
Example
You want to update username, usertype
of a user obtained in the log in page :
Android
Copied to your clipboardvar attributes = new Dictionary<string, Java.Lang.Object>();attributes.Add("username", "will_smith");attributes.Add("usertype", "Actor");ACPUserProfile.UpdateUserAttributes(attributes);
iOS
Copied to your clipboardvar attributes = new NSMutableDictionary<NSString, NSString>{["username"] = new NSString("will_smith"),["usertype"] = new NSString("Actor")};ACPUserProfile.updateUserAttributes(attributes);