Closed otani-mnbf closed 2 months ago
It got it to work. This is what I did. Cheers!
app.json
"plugins": [
...
[
"react-native-fbsdk-next",
{
"appID": "14124113217378",
"clientToken": "fb7dddxxxe4eac1120535xxx",
"displayName": "demo-app",
"scheme": "fb14124113217378",
"advertiserIDCollectionEnabled": false, // must be false by default
"autoLogAppEventsEnabled": false, // must be false by default
"isAutoInitEnabled": true // must be true by default
}
]
]
App.jsx
...
import { isDev, isExpoGo } from '@config/env';
export default function App() {
const getFacebookSDK = useCallback(async () => {
return (await import('react-native-fbsdk-next')).Settings;
}, []);
useEffect(() => {
const initSDK = async () => {
if (!isDev && !isExpoGo) {
const fbSDK = await getFacebookSDK();
fbSDK.initializeSDK();
fbSDK.setAutoLogAppEventsEnabled(true); // add this
fbSDK.setAdvertiserIDCollectionEnabled(true); // add this
}
};
initSDK();
}, [getFacebookSDK]);
return (
<MainApp />
)
Needs help
using Expo, I can install the SDK without any problem by following the README, and I'm trying to initialize the SDK only on production env so it collects only real-world data.
so what I did is
isAutoInitEnabled
false in app.json(to disable the auto initialization on Android)package.json
app.json
App.jsx
, which doesn't seem working on Android although it does on iOS for some reason...
not working
I mean, on Meta Console I can't see any numbers of sdk_initialization on Android and AppInstalls count doesn't seem correct cuz it doesn't match the one on GooglePlayConsole.so if anyone knows anything about it or how to achieve it, Please let me know here🙏 Thank you!