Comments (18)
@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"
from react-native-fbsdk-next.
Seems to me that this use case is a good one to be documented for more clarity.
from react-native-fbsdk-next.
@glenna Thanks for your reply. That explains a lot.
from react-native-fbsdk-next.
ATT is not automatic - you need https://github.com/zoontek/react-native-permissions#ios
from react-native-fbsdk-next.
FacebookAutoLogAppEventsEnabled
hey ! FacebookAutoLogAppEventsEnabled
is not in the Settings object, so I do a Settings.FacebookAutoLogAppEventsEnabled
I have an undefined res...
Do you know where can I find the app event for install ? thanks :)
from react-native-fbsdk-next.
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:
- iOS SDK changelog
- Facebook's iOS 14 announcements
- Facebook SDK documentation on App events + advertising tracking
- Facebook documentation for limited login on iOS 14+
- Facebook GDPR compliance documentation -- useful, because you would also need to delay initialization of the Facebook SDK for iOS 14.5+
from react-native-fbsdk-next.
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!
from react-native-fbsdk-next.
@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 componentDidMountthen 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 projectIn 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 gopermissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-AppTrackingTransparency', :path => "#{permissions_path}/AppTrackingTransparency/Permission-AppTrackingTransparency.podspec"
You are my super hero! :)
Thank you so much!
P.s. I changed only the line from
pod 'Permission-AppTrackingTransparency', :path => "#{permissions_path}/AppTrackingTransparency/Permission-AppTrackingTransparency.podspec"
to
pod 'Permission-AppTrackingTransparency', :path => "#{permissions_path}/AppTrackingTransparency.podspec"
from react-native-fbsdk-next.
Hello,
I have an add campaign with Facebook that measures app installs.
I updated FBSD to v.4.2.0
I stated in the submission process in Apple Store that my app is using tracking functionality.
My app is rejected already twice with this statement:
- 5.1.2 The app privacy information you provided in App Store Connect indicates you collect data in order to track the user, however, no permission request was observed.
I was thinking that permission request will be displayed automatically by the iOS.
Am I wrong?
If I only want to register app installations - do I need to use AppTrackingTransparency and to enable Facebook events?
Thanks
from react-native-fbsdk-next.
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 ?
from react-native-fbsdk-next.
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
from react-native-fbsdk-next.
@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
from react-native-fbsdk-next.
@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 componentDidMountthen 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 projectIn 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 gopermissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-AppTrackingTransparency', :path => "#{permissions_path}/AppTrackingTransparency/Permission-AppTrackingTransparency.podspec"
- I've done from this;
- I've done everything from README.
But events still don't display in FB Events page :(
from react-native-fbsdk-next.
@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"
- I've done from this;
- I've done everything from README.
But events still don't display in FB Events page :(
which ios sdk do you use?
from react-native-fbsdk-next.
@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"
- I've done from this;
- I've done everything from README.
But events still don't display in FB Events page :(
which ios sdk do you use?
It autolinked with 9.3 version.
from react-native-fbsdk-next.
may be I should do something extra in AppDelegate.m ? Something that was not provided in official documentation
from react-native-fbsdk-next.
I add this to AppDelegate.m to see some logs:
[FBSDKSettings enableLoggingBehavior:FBSDKLoggingBehaviorNetworkRequests];
[FBSDKSettings enableLoggingBehavior:FBSDKLoggingBehaviorDeveloperErrors];
[FBSDKSettings enableLoggingBehavior:FBSDKLoggingBehaviorInformational];
[FBSDKSettings enableLoggingBehavior:FBSDKLoggingBehaviorAppEvents];
[FBSDKSettings enableLoggingBehavior:FBSDKLoggingBehaviorGraphAPIDebugInfo];
Example of the output:
Events: [
{
"event" : {
"_eventName" : "Start",
"_logTime" : 1630410267,
"_valueToSum" : 0,
"_ui" : "UIViewController"
},
"isImplicit" : false
}
]
Flush Result : Success
Network logs response: 200 - success.
So, event are gone to FB, but not displayed in EventsManager :(
from react-native-fbsdk-next.
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
from react-native-fbsdk-next.
Related Issues (20)
- [Expo] How to initialize SDK only on specific build? HOT 1
- share link url can't show preview link HOT 1
- `Could not resolve com.facebook.android:facebook-android-sdk:16.+.` due to Bad Gateway for https://oss.sonatype.org HOT 2
- IOS build failed with FBSDKCoreKit/FBSDKCoreKit.modulemap not found HOT 1
- Build error: Showing Recent Messages Error [ERR_REQUIRE_ESM]: require() of ES Module... HOT 2
- support version 17 of facebook sdk with privacy manifests HOT 14
- Will this lib be updated to meet Apple's new third party sdk privacy manifest requirement? HOT 2
- Can't change to another account on login HOT 3
- iOS limited login HOT 14
- Email not retrieving from facebook login HOT 3
- Need help for the facebook sharing HOT 1
- Facebook SDK not initialized error when using react-native-fbsdk-next with Expo HOT 7
- FbLoginManager.loginwithPermissions was called with 1 arguments butt expects 3 arguments HOT 2
- LoginManager.logOut() doesn't remove app from Facebook "Business Integrations" HOT 1
- App switches automatically to limited login when updated to v13 HOT 4
- Access Token is invalid HOT 6
- React native app - Upgrade fbsdk to version 9.0.0 HOT 1
- Mobile product ads aka Advantage+ Catalog Ads not receiving params HOT 2
- Upgrading to v13.0.0 , build failed for android HOT 6
- iOS limited login does not return all possible fields HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-fbsdk-next.