facebookarchive / react-native-fbsdk

A React Native wrapper around the Facebook SDKs for Android and iOS. Provides access to Facebook login, sharing, graph requests, app events etc.
https://developers.facebook.com/docs/react-native
Other
2.99k stars 909 forks source link

Add getters for anonymousID, attributionID and advertiserID #805

Closed VEnom42 closed 3 years ago

VEnom42 commented 3 years ago

Fixes #599

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.