This document details all the APIs provided by UserProfile, along with sample code snippets on how to properly use the APIs.
For more in-depth information about the UserProfile extension, visit the SDK documentation on UserProfile.
UserProfile.updateUserAttributes(attributeDict: ["username": "Will Smith", "usertype": "Actor"])
NSMutableDictionary *profileMap = [NSMutableDictionary dictionary];
[profileMap setObject:@"username" forKey:@"will_smith"];
[profileMap setObject:@"usertype" forKey:@"Actor"];
[AEPMobileUserProfile updateUserAttributesWithAttributeDict:profileMap];
UserProfile.removeUserAttributes(attributeNames: ["itemsAddedToCart"])
[AEPMobileUserProfile removeUserAttributesWithAttributeNames:@[@"username", @"usertype"]];
UserProfile.getUserAttributes(attributeNames: ["itemsAddedToCart"]) {
attributes, error in
// your customized code
}
[AEPMobileUserProfile getUserAttributesWithAttributeNames:@[@"username", @"usertype"] completion:^(NSDictionary* dict, NSError* error){
// your customized code
}];