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

setAdvertiserTrackingEnabled not found #839

Closed sanealytics closed 3 years ago

sanealytics commented 3 years ago

🐛 Bug Report

I have been using this package for a few years and all events had been flowing through to events manager. Events manager is telling me that for iOS 14, I need a newer version. I do have the latest version of this SDK. I tried the sample code from https://github.com/facebook/react-native-fbsdk/pull/804 to check. And I'm getting

TypeError: _reactNative.Settings.setAdvertiserTrackingEnabled is not a function. (In '_reactNative.Settings.setAdvertiserTrackingEnabled(true)', '_reactNative.Settings.setAdvertiserTrackingEnabled' is undefined)

I have checked all the installation steps again. My fbsdk is set to ^3.0.0 FBSDKCoreKit (8.2.0)

But clearly I'm missing something if I can't get to this setting.

Any suggestions are appreciated.

To Reproduce

Please follow the code example.

Expected Behavior

Should be able to see ATE settings.

Code Example

         <Button
            title="ATE"
            onPress={() =>
            Settings.setAdvertiserTrackingEnabled(true).then( (result) => {
              console.log("is success: " + result);
              Settings.getAdvertiserTrackingEnabled().then((result) => {
                console.log("ATE: " + result);
                Settings.setAdvertiserTrackingEnabled(false).then( (result) => {
                console.log("is success: " + result);
                Settings.getAdvertiserTrackingEnabled().then((result) => {
                  console.log("ATE: " + result)
                });
              })
              });
            })
          }/>
          <Button
            title="DPO"
            onPress={() =>
            Settings.setDataProcessingOptions(["a", "b"])
          }/>

Environment

System: OS: macOS 11.2 CPU: (8) x64 Intel(R) Core(TM) i7-8569U CPU @ 2.80GHz Memory: 270.80 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 14.9.0 - /usr/local/bin/node Yarn: 1.22.4 - /usr/local/bin/yarn npm: 6.14.8 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Managers: CocoaPods: 1.9.1 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 14.3, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2 Android SDK: API Levels: 28, 29 Build Tools: 28.0.3, 29.0.2, 29.0.3 System Images: android-28 | Intel x86 Atom_64, android-R | Google APIs Intel x86 Atom Android NDK: Not Found IDEs: Android Studio: 4.0 AI-193.6911.18.40.6514223 Xcode: 12.3/12C33 - /usr/bin/xcodebuild Languages: Java: 1.8.0_222 - /usr/bin/javac Python: 3.7.3 - /usr/local/anaconda3/bin/python npmPackages: @react-native-community/cli: Not Found react: 16.13.1 => 16.13.1 react-native: 0.63.4 => 0.63.4 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

rahulmandalkarsen386 commented 3 years ago

I am also getting the same issue

goodifycesar commented 3 years ago

Unfortunately the current version does not support the latest FB SDK (v9), which is why a lot of us are having issues related to this repo + FB Event manager. Main thread is here https://github.com/facebook/react-native-fbsdk/issues/832

sanealytics commented 3 years ago

Thanks @goodifycesar. Closing this and following up there.

goodifycesar commented 3 years ago

Cheers! Looks like things are happening in this repo https://github.com/thebergamo/react-native-fbsdk-next/pull/1