onInstallConversionData callback doesn't trigger if ATT is enabled?
Report
Plugin Version
6.2.42
On what Platform are you having the issue?
iOS
What did you do?
In my iOS settings, I have ATT disabled.
I rely on appsFlyer.onInstallConversionData(res => ...) being fired so I can then unhide the main contents of the app.
What did you expect to happen?
onInstallConversionData to have its callback called.
What happened instead?
It never called. I think maybe on killing and reopening the app it did?
Please provide any other relevant information.
I expected source to be either success or failure, instead of not getting a reply. Even with ATT off, I would still expect the callback to fire.
Also, maybe appsFlyer.stop()being run at some earlier time had somehow interfered and caused this issue.
I have stopped relying on the callback firing in order to satisfy some condition in my code, so instead I use requestTrackingStatus() to let me know a user has disabled ATT altogether and fulfilled the conditions for my app to work.
Hi @gtsec and thank you for opening this issue.
appsFlyer.onInstallConversionData is not related to the ATT and it will fire only after appsFlyer.init sends a launch.
it can be delayed if you set number in the timeToWaitForATTUserAuthorization field like here
My problem is different now, basically there is a scenario where:
- User has my app already installed, ATT is disabled
- User now enables ATT, opens app
- In the following code,
appsFlyer.onInstallConversionData(res => ...does not trigger again after user presses Allow when seeing the ATT prompt
appsFlyer.initSdk(
{
devKey: env.APPSFLYER_DEV_KEY,
isDebug: env.IS_PRODUCTION == 'false',
appId: env.APPSFLYER_APP_ID,
onInstallConversionDataListener: true, // Optional
onDeepLinkListener: true, // Optional
timeToWaitForATTUserAuthorization: 10, // for iOS 14.5
})
const App = () => {
// some other code...
useEffect(() => {
let onInstallConversionDataCanceller = null // appsFlyer.onInstallConversionData(res => dispatch(setInstallationConversionData(res)))
requestTrackingPermission().then(trackingStatus => {
if (
trackingStatus !== 'authorized' &&
trackingStatus !== 'unavailable'
) {
appsFlyer.stop(true)
dispatch(setInstallationConversionStatus('failure'))
} else { // user has suddenly allowed it
onInstallConversionDataCanceller = appsFlyer.onInstallConversionData(res => {
dispatch(setInstallationConversionData(res))
})
}
dispatch(setTrackingStatus(trackingStatus))
})
appsFlyer.getAppsFlyerUID((err, appsFlyerUID) => {
if (err) {
console.error('appsFlyer.getAppsFlyerUID error:', err);
} else {
dispatch(setAppsFlyerId(appsFlyerUID))
}
})
return () => {
onInstallConversionDataCanceller && onInstallConversionDataCanceller()
}
}, [])
Hi @gtsec. according to this, you must set the appsFlyer.stop to false if you want to trigger appsFlyer.onInstallConversionData again
I'm experiencing this issue now regardless, on XCode + iOS Simulator at least. This is a bit of a pain and I have no idea why the callback doesn't call. It would be way, way better if the callback finishes no matter what, or at least throw some sort of error! Otherwise its just very difficult to figure out what I might have done wrong.
Here's the code I had: AppsFlyer version = 6.26 XCode 12.5, but also not working for someone else on 12.4
I've attempted putting appsFlyer.onInstallConversionData(res => { ... }) at the very top of App.tsx, before I call appsFlyer.initSdk(), but the callback still never fires.... why?
This is issue is closed due to inactivity. Contact our support team if the issue has not been solved