initSession behavior onPlatformResume and onPlatformReady
See original GitHub issueHey,
I used the following code snippet which is called both on platform.ready and in platform.resume.subscribe
Branch.initSession((data) => {
alert('initSession Deep Link Data: ' + JSON.stringify(data));
}).then((res) => {
alert('Response: ' + JSON.stringify(res))
}).catch((err) => {
alert('Error: ' + JSON.stringify(err))
});
and I observed the following behavior using ionic 3:
- When the app starts:
- a: without clicked deeplink: only Response is called
- b: with clicked deeplink: BOTH initSession AND Response are called
- When the app resumes:
- a: without clicked deeplink: NOTHING is called
- b: with clicked deeplink: initSession is called but not Response
My first question is, if this is the intended behavior?
My most pressing question is: If this is the intended behavior: why is nothing called in case 2a? I want to handle this case in my app
A minor question is: If it is the intended behavior: why are 1b and 2b inconsistent?
I am looking forward to your response 😃
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
initSession behavior onPlatformResume and onPlatformReady
Hey, I used the following code snippet which is called both on platform.ready and in platform.resume.subscribe Branch.initSession((data) ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello everybody!
I apologize for the delay. I got pull into another team so the Branch Cordova SDK hasn’t seen much love. The good news is I just updated the Branch Cordova SDK. I would recommend updating to the latest
2.7.0
version. You can use this guide to update the SDK. Keep in mind, this version has a breaking change. The following change will need to be done to your code to read the deep link data. You can find more infomation about reading deep link data here.Thanks,
I would like to stress a small extension to the post of @codinronan
While the .then() helps you in cases, when the app is closed, it does not help you when the app resumes (as I stated in my initial post under scenario 2a).
Thus, you can not find out in a deterministic way if there might be a link clicked or not. The result is, that if you open special content, there will always be a delay until you actually know which content to show. (This delay is caused by the link evaluation by the branch SDK.) In my tests, this delay ranged between 500-1500ms. However, I also tested in cases with bad Internet connection and received the special response after 5000-10000ms which alienated the user.
Summing up, it would help us developers to deliver a seamless experience if the branch SDK could handle all four cases (see my original post) in a deterministic way.