-1

Just wanted some help on how I could use the following code to timeout after 5 seconds. Context: This is a Branch.io banner ad and I'm trying to program in such a way that the ad banner closes automatically after 5 seconds. The relevant part of the documentation is given below and I'm new to coding.

‘branch.closeJourney(function(err) { console.log(err); });’

More details here: https://blog.branch.io/7-advanced-controls-to-help-you-optimize-your-journeys/

Thanks for your help!

  • 1
    Please add a tag for the language you are using, also this question is too broad. Also add more details to exactly what you are trying to do here. – Spencer Wieczorek Jan 06 '18 at 16:22
  • Hi Spencer, Thanks for your reply. I'm new to coding. But essentially what I'm trying to do here is try and close my Branch.io Journeys banner ad automatically after it's shown for 5 seconds. – Suresh Thiyagaraj Jan 06 '18 at 16:41

1 Answers1

0

It seems that this is not a Branch-specific issue as you simply want to call a function (closeJourney) after a certain delay (6 seconds). The Branch method does not have an argument for you to specify a delay because typically, users will press the dismiss button if they do not want to see the banner anymore.

If you want to execute a function after a certain delay, it might be helpful to check out a Java (if you are coding in Android) implementation of the setTimeout method: What is the equivalent of javascript setTimeout in Java?

Brian Chang
  • 169
  • 2