I'm trying to make integrate Facebook App event into react native using this lib: https://github.com/thebergamo/react-native-fbsdk-next
Everything work well on android, expect for ios I setup everything correct according to the doc:
I add on Info.plist
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fbFB-ID</string>
</array>
</dict>
</array>
<key>FacebookAppID</key>
<string>FB-ID</string>
<key>FacebookDisplayName</key>
<string>APP NAME</string>
<key>LSApplicationQueriesSchemes</key>
I add this line on AppDelegate.m
And i setup that on App.js
useEffect(() => {
Settings.setAppID(`${enviornment.FB_APP_ID}`)
Settings.setAdvertiserTrackingEnabled(true).then(() => Settings.initializeSDK())
}, [])
And test it by:
<TouchableOpacity
onPress={() => {
AppEventsLogger.logEvent(
`login on ${Platform.OS} at ${new Date().getHours()}: ${new Date().getMinutes()}`,
)
console.log("run")
}}
>
<Text>Log</Text>
</TouchableOpacity>
But it NEVER LOG on dashboard, only work by android:
So what i did wrong??? And how to make it work?
ios version is 15.4 and i already grant access to app tracking transparency by using this lib https://github.com/mrousavy/react-native-tracking-transparency
const requestTracking = React.useCallback(async () => {
try {
const status = await requestTrackingPermission()
console.log("status", status)
setTrackingStatus(status)
} catch (e: any) {
Alert.alert("Error", e?.toString?.() ?? e)
}
}, [])