Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 58 additions & 4 deletions packages/userprofile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,60 @@ npm install @adobe/react-native-aepuserprofile

Initializing the SDK should be done in native code, documentation on how to initialize the SDK can be found [here](https://github.com/adobe/aepsdk-react-native#initializing).

**Initialization Example**

iOS
```objc
// AppDelegate.h
@import AEPCore;
@import AEPUserProfile;
...
@implementation AppDelegate

// AppDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[AEPMobileCore setLogLevel: AEPLogLevelDebug];
// register UserProfile extension
[AEPMobileCore registerExtensions:@[AEPMobileUserProfile.class] completion:^{
[AEPMobileCore configureWithAppId:@"yourAppID"];
...
}];
return YES;
}

@end
```

Android
```java
import com.adobe.marketing.mobile.LoggingMode;
import com.adobe.marketing.mobile.MobileCore;
import com.adobe.marketing.mobile.UserProfile;

...
import android.app.Application;
...
public class MainApplication extends Application implements ReactApplication {
...
@Override
public void on Create(){
super.onCreate();
...
MobileCore.setApplication(this);
MobileCore.setLogLevel(LoggingMode.DEBUG);
MobileCore.configureWithAppID("yourAppID");

UserProfile.registerExtension();// register UserProfile extension

MobileCore.start(new AdobeCallback() {
@Override
public void call(Object o) {

}});
}
}
```

#### Importing the extension:

In your React Native application, import the UserProfile extension as follows:
Expand All @@ -38,7 +92,7 @@ import {UserProfile} from '@adobe/react-native-aepuserprofile';

## API reference

- ### extensionVersion
### extensionVersion

Returns the version of the User Profile extension

Expand All @@ -54,7 +108,7 @@ extensionVersion(): Promise<string>
UserProfile.extensionVersion().then(version => console.log("AdobeExperienceSDK: UserProfile version: " + version));
```

- ### getUserAttributes
### getUserAttributes

Gets the user profile attributes with the given keys.

Expand All @@ -70,7 +124,7 @@ getUserAttributes(attributeNames: Array<string>): Promise<?{ string: any }>
UserProfile.getUserAttributes(["mapKey", "mapKey1"]).then(map => console.log("AdobeExperienceSDK: UserProfile getUserAttributes: " + map));
```

- ### removeUserAttributes
### removeUserAttributes

Removes the user profile attributes for the given keys.

Expand All @@ -86,7 +140,7 @@ removeUserAttributes(attributeNames: Array<string>)
UserProfile.removeUserAttributes(["mapKey1"]);
```

- ### updateUserAttributes
### updateUserAttributes

Sets the user profile attributes key and value.
It allows to create/update a batch of user profile attributes.
Expand Down