Branch link and lifecycle callbacks


I am using Branch to Deeplink to an Activity in my app. This activity is NOT the splash activity. I have added the intent filter and the metadata tag to that particular activity in the Androidmanifest.

Normal app flow – In the onCreate() of the activity, I get data from Intent and use that data ahead in the activity. I want this same thing to happen in case of deeplink too.

Branch flow –

what i have done

  1. onStart() –> I init a Branch session.
  2. onResume() –> I check for Branch.isAutoDeeplinkLaunch(this)
  3. onNewIntent()–> setIntent(intent) . Marked activity as SingleTop in Manifest

What happens when a Branch deeplink is clicked from Whatsapp. (It should ideally deeplink to this activity in the app)

What actually happens –

  1.  Calls onCreate()
  2. Calls onStart(). Starts initing the session.
  3. Before initSession() callback is called, onResume() is called. Here, now Branch.isAutoDeeplinkLaunch returns false
  4. onInitSession() callback is now called. I get my referringParams.
  5. onPause() is now called
  6. onNewIntent() is called
  7. onStart() is again called. Here again init() happens. And i get the callback then and there. No delay
  8. onResume() gets called. Here, now Branch.isAutoDeeplinkLaunch returns true!

I have followed the documentation, but somewhere it seems vague and confusing. Any help? — Developer
1 Answer(s)
Answered on July 24, 2016.

Hi there!

This sounds like a more in-depth technical question, and would be better for our Integrations team. Could you send them a ticket? They’ll be able to help out.

Branch — Developer