r/appdev • • 19d ago

AppsFlyer Flutter SDK initialization order? Deep link data only shows up after the first relaunch

Flutter dev at a coffee loyalty app (40ish stores). We added the appsflyer_sdk plugin for our paid installs.

Issue: on a fresh install from a OneLink, the deep link callback is empty on first open. Happens on both iOS and Android, so I don't think it's a platform thing. kill the app, reopen it and suddenly the data's there.

Also not sure where the ATT prompt should go relative to init. Right now it fires on the splash screen before anything else.

Current order in main(): Firebase init, ATT request, AppsflyerSdk(options), initSdk() and then onDeepLinking gets registered later in the home widget.

What's the right order here? Is this a known Flutter thing or am I just doing it wrong.

3 Upvotes

5 comments sorted by

View all comments

1

u/Sayuri_Feasby 19d ago

For ATT, the AppsFlyer options have timeToWaitForATTUserAuthorization, so the SDK holds the install event for a few seconds waiting on the prompt result. Set that, then show ATT inside that wait window instead of on splash before the SDK even exists

1

u/Aggressive-Wave-9782 18d ago

Okay, let me look into into it.

1

u/Just_Moment1561 3d ago

timeToWaitForATTUserAuthorization => It is removed in the newer update.