Android Deep Linking post user event


In some cases the user is required to go through some kind of an event before continuing to application page pointed by deep linking destination.
Examples for such user events:

  1. Login process
  2. Splash screen
  3. Consenting to usage terms


In order to sync easily and safely between the user event and the deferred deep linking flow, it is recommended to initiate and start the SDK in the activity context where the user event is performed. For example, the view which implements the login process. This is different from the normal flow, where the SDK is initiated and started in the application context.
The callbacks which are used in the Extended Deferred Deep Linking flow should also be called in the activity context.
It is the developer's responsibility to save the deferred deep linking and direct deep linking data, route the user to the required destination only after the event is performed.

Contoh kode

In this Github branch you can find a code sample which waits for a pseudo-user authencation before continuing to the deep linking destination. Once the authentication is verified, the user is directed to the destination. This flow is relevant for both deferred deep linking and direct deep linking (when the app is already installed).
You can see that the application context has no AppsFlyer SDK code. The AppsFlyer code moved entirely into the activity which perform the user event.