How to interval deep link on webview to keep native app session alive?

Viewed 175

For example I have native app and I open webview from my app. I need to keep my app alive because If my native app have no activity in 5 mins the session will be expire. So that I have to pass deep link to website So website can keep interval my native app deep link to make native app alive. The Question is How can I write the code to call deep link without reloading or re-direct website page ?

1 Answers

In short, no.

One option would be to (a) refactor the app to more gracefully handle expired sessions (e.g. sign in again) and (b) refactor server to allow new session to restore state of prior session.

Another option would be to change the server implementation so that sessions don’t expire so quickly.

And if you are opening a your web view from within your native app (as opposed to launching a web browser app), your app is actually still running, so there’s nothing to stop you from having some timer that fires off some task periodically to keep it alive from the server’s perspective.

But your answer does not rest within some sly use of deep links.

Related