Skip to content
Open
Show file tree
Hide file tree
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
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,16 @@ MParticle.Identity.modify(request, (error, userId) => {
});
```

```js
MParticle.Identity.getCurrentDeviceApplicationStamp((error, deviceApplicationStamp) => {
if (error) {
console.debug(error); //error is an MParticleError
} else {
console.debug(deviceApplicationStamp);
}
});
```

## Attribution
```
var attributions = MParticle.getAttributions();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,12 @@ public void getCurrentUserWithCompletion(Callback completion) {

}

@ReactMethod
public void getCurrentDeviceApplicationStampWithCompletion(Callback completion) {
MParticleUser deviceApplication = MParticle.getInstance().Identity().getDeviceApplicationStamp();
completion.invoke(null, deviceApplication);
}

@ReactMethod
public void aliasUsers(final ReadableMap readableMap, final Callback completion) {
IdentityApi identityApi = MParticle.getInstance().Identity();
Expand Down
5 changes: 5 additions & 0 deletions ios/RNMParticle/RNMParticle.m
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,11 @@ + (void)load {
completion(@[[NSNull null], [[[MParticle sharedInstance] identity] currentUser].userId.stringValue]);
}

RCT_EXPORT_METHOD(getCurrentDeviceApplicationStampWithCompletion:(RCTResponseSenderBlock)completion)
{
completion(@[[NSNull null], [[[MParticle sharedInstance] identity] deviceApplicationStamp]]);
}

RCT_EXPORT_METHOD(getUserIdentities:(NSString *)userId completion:(RCTResponseSenderBlock)completion)
{
MParticleUser *selectedUser = [[MParticleUser alloc] init];
Expand Down
10 changes: 10 additions & 0 deletions js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,16 @@ class Identity {
NativeModules.MParticle.aliasUsers(AliasRequest, completion)
}

static getCurrentDeviceApplicationStamp (completion) {
NativeModules.MParticle.getCurrentDeviceApplicationStampWithCompletion((error, deviceApplicationStamp) => {
if (error) {
var parsedError = new MParticleError(error);
completion(parsedError, undefined);
return;
}
completion(undefined, deviceApplicationStamp);
});
}
}

// ******** Commerce ********
Expand Down