The new Branch.io Cordova SDK the documentation makes it clear that the SDK automatically closes the current branch session when the app is paused or backgrounded, but it does not seem to automatically init a new session when the app is resumed from memory.
If the app is resumed after it's been killed from memory, the branch.init
method in my app's onReady
code does execute - this is only an issue when resuming a paused app.
Do I need to trigger another init manually? Any insight would be great!
I'm Scott with Branch, and the lead architect for the Web SDK (which includes the Cordova SDK). Yes, you're correct that the SDK automatically closes the Branch session whenever the app is paused. However, it does not (yet) automatically initialize a new session when it is resumed. Which means, you do need to trigger another init manually everytime the
resume
event fires.Bind this event as you would any other startup event listener:
We've had a number of requests to automatically call init on resume, and will be releasing this shortly! I'll make a note to update this response once we've done so.