Skip to content
This repository has been archived by the owner on Apr 2, 2021. It is now read-only.

Add getters for anonymousID, attributionID and advertiserID #805

Merged
merged 2 commits into from Nov 11, 2020

Conversation

VEnom42
Copy link
Contributor

@VEnom42 VEnom42 commented Oct 29, 2020

Fixes #599

  • Added access to anonymousID, attributionID and advertiserID from native sdks.

Test Plan:

Integrate the sdk to any project and try to get this values:

import {AppEventsLogger} from 'react-native-fbsdk';
...
    AppEventsLogger.getAnonymousID()
      .then(anonymousID => {
        console.log('anonymousID fbsdk', anonymousID);
      })
      .catch(e => {
        console.error(e);
      });
    AppEventsLogger.getAdvertiserID()
      .then(advertiserID => {
        console.log('advertiserID fbsdk', advertiserID);
      })
      .catch(e => {
        console.error(e);
      });
    AppEventsLogger.getAttributionID()
      .then(attributionID => {
        console.log('attributionID fbsdk', attributionID);
      })
      .catch(e => {
        console.error(e);
      });
...

Note that attributionID will be empty on emulators.

*
* @return The GUID for this app/device pair.
*/
@ReactMethod(isBlockingSynchronousMethod = true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can make all the functions not blocking and use the promise API since they are async in JS anyway.

Copy link
Contributor

@janicduplessis janicduplessis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thanks!

@janicduplessis janicduplessis merged commit fd54d9f into facebookarchive:master Nov 11, 2020
lukefanning pushed a commit to SolidStateGroup/react-native-fbsdk that referenced this pull request Nov 18, 2020
…archive#805)

* add getters for anonymousID, attributionID and advertiserID

* use promise api instead of blocking methods
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cant send advertiser_id with custom events
3 participants