react-native-branch-deep-linking-attribution icon indicating copy to clipboard operation
react-native-branch-deep-linking-attribution copied to clipboard

[SDK-1562] Add callback to setIdentity

Open nsingh-branch opened this issue 3 years ago • 1 comments

Description

Adds a new method, setIdentityWithPromise, which sets the identity/developer_identity and has a promise with returns the first referring params. There already is a setIdentity functions which works the same and will still exist. However, it is void/does not return, which is why adding a new method which does.

The native SDKs have two versions of setIdentity, one with a callback and one thats void. This new method uses the one with a callback.

Usage/Examples

Existing setIdentity()

branch.setIdentity("user123")

New setIdentityWithPromise()

let result = branch.setIdentityWithPromise("user456");
    result.then((params) => {
      console.log('setIdentityWithPromise Result: ', params)
});

nsingh-branch avatar Aug 09 '22 21:08 nsingh-branch

Can you add more to the description? What did the calls look like previously and what have they changed to now?

gdeluna-branch avatar Aug 10 '22 20:08 gdeluna-branch