I have a app in react native. I want to track facebook pixel events on 2 different pixel accounts. I am using react-native-fbsdk-next
I have tried adding
Settings.setAppID('PIXEL_1'); Settings.setAppID('PIXEL_2');
but not working. As default pixel configuration is been added in android manifest and info.plist:
AndroidManifest.xml
<application ...>
<meta-data android:name="com.facebook.sdk.ClientToken" android:value="@string/facebook_client_token"/>
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>
...
...
</application>
Info.plist
<key>FacebookAppID</key>
<string>PIXEL_APP_ID</string>
<key>FacebookClientToken</key>
<string>PIXEL_CLIENT_TOKEN</string>
You can define the Facebook id programmatically. So you do not need to setup the facebook id manifest or info.plist file.
Android
iOS
At last, when you need to change it you have to create a native bridge to update that facebook id. Please use react-native- document. link