-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do we need latest fbsdk to support iOS 14 AppTrackingTransparency #24
Comments
In general, the Facebook SDK is independent from the ATT framework. Regarding the need to update your Facebook SDK to a newer version depends on how you use the Facebook SDK in your own application, and your needs for continuing to do performance marketing for, or serving ads in your app in iOS 14.5 with the new tracking requirements/restrictions in place from Apple. If you are using Facebook's event tracking, then it is my understanding that you will need Facebook SDK version 8.1 or higher, as you need to be able to let the SDK know if you've gotten consent from the user to use their advertising identifier. You may also need to delay the initialization of the Facebook SDK in this regard as well (it depends on if you are allowing the Facebook SDK to automatically track app events such as install, purchase, etc). I recommend taking a look at some of the available documentation to get a better idea of what you need specifically for your app:
|
@glenna Thanks for your reply. That explains a lot. |
Hello, I have an add campaign with Facebook that measures app installs. My app is rejected already twice with this statement:
I was thinking that permission request will be displayed automatically by the iOS. If I only want to register app installations - do I need to use AppTrackingTransparency and to enable Facebook events? Thanks |
ATT is not automatic - you need https://github.com/zoontek/react-native-permissions#ios |
Seems to me that this use case is a good one to be documented for more clarity. |
I have implemented the latest version of fbsdk-next and i've been using the fb events. The events are working fine on android and iOS < 14. But the events from iOS 14+ are not shown. My app doesnt show the ATT. If i show and accept ATT in the app, the events are shown. Does this mean that fb events will only be fired when ATT is accepted ? |
This question might be better targeted to the upstream SDK @andreshsingh , I don't think we are doing anything special there other than supporting an API to enable/disable a tracking setting before initializing the API via a second API. If you are not doing that and the events are still going or not based on ATT status, that seems like a native SDK behavior. If you try that and learn anything please share it back here! |
I've almost tried everything but not able to log Events on iOS however Android same code working fine, no build error, successfully able to run. Here is my code => import {AppEventsLogger, Settings} from 'react-native-fbsdk-next'; export const facebookSDKInit = async () => { const trackingStatus = await requestTrackingPermission(); if (Platform.OS === 'ios' && parseInt(Platform.Version) > 13) { if (trackingStatus === 'authorized') { await Settings.setAdvertiserTrackingEnabled(true); } } Settings.initializeSDK(); }; I'm calling this in App.js file on component mount and it's asking me for permission import {AppEventsLogger, Settings} from 'react-native-fbsdk-next'; AppEventsLogger.logEvent('login',{user : 'user', email : 'email'}); On Android everything working fine Someone can help me here Thanks in Advance |
@dhayaljaswantgit have you tried to test if the events are firing correctly when the user has accepted ATT permission? Last time i checked it was working only for this specific scenario |
@andreshsingh Thanks for the reply, You are right, I was able to fix the issue by adding ATT permission, I've tried the same solution before logging the issue but that time it was not working, maybe I was missing something, today again I've tried this and this time it was working... I'm adding my working code here, it may save other developers time => import {AppEventsLogger, Settings} from 'react-native-fbsdk-next'; import {PERMISSIONS, RESULTS, request, check} from 'react-native-permissions'; export async function initPixel() { if (Platform.OS === 'ios') { const ATT_CHECK = await check(PERMISSIONS.IOS.APP_TRACKING_TRANSPARENCY); if (ATT_CHECK === RESULTS.DENIED) { try { const ATT = await request(PERMISSIONS.IOS.APP_TRACKING_TRANSPARENCY); if (ATT === RESULTS.GRANTED) { Settings.setAdvertiserTrackingEnabled(true).then(() => { Settings.initializeSDK(); }); } } catch (error) { throw error; } finally { Settings.initializeSDK(); } Settings.initializeSDK(); Settings.setAdvertiserTrackingEnabled(true); Settings.FacebookAutoLogAppEventsEnabled(true); } } else { Settings.initializeSDK(); Settings.setAdvertiserTrackingEnabled(true); } } I'm calling this function on my App.js componentDidMount then simply logging a event like => AppEventsLogger.logEvent('test', 14, {type: 'ios'}); //Test Event Before that make sure you should add react-native-permissions plugin and clean your project In you Info.plist file you need to add below permission => NSUserTrackingUsageDescription App would like to access IDFA for tracking purpose Add below code to your pod file and just run pod install command and you are good to go permissions_path = '../node_modules/react-native-permissions/ios' pod 'Permission-AppTrackingTransparency', :path => "#{permissions_path}/AppTrackingTransparency/Permission-AppTrackingTransparency.podspec" |
hey ! |
You are my super hero! :) P.s. I changed only the line from |
But events still don't display in FB Events page :( |
which ios sdk do you use? |
It autolinked with 9.3 version. |
may be I should do something extra in AppDelegate.m ? Something that was not provided in official documentation |
I add this to AppDelegate.m to see some logs:
Example of the output: Network logs response: 200 - success. So, event are gone to FB, but not displayed in EventsManager :( |
facebook-ios-sdk v11 (which should support it) is going to release shortly. Until then you may like #66 (comment) - please post a PR to the docs if they can be more clear, we need contributors |
I use fbsdk just log events in the fbapp and nothing more. Do I need to upgrade to latest FBSdk and will it impact on approval of my iOS apps?
馃悰 Bug Report
To Reproduce
Expected Behavior
Code Example
Environment
The text was updated successfully, but these errors were encountered: