1

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 Answers1

1

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.

Rob
  • 415,655
  • 72
  • 787
  • 1,044
  • Oh I see That's mean in case I open my web as native app webview I don't have to worry about my native app going to Inactive right ? – ㅤㅤㅤㅤㅤ Dec 26 '20 at 08:52
  • I’m not sure what you mean by “about my native app going inactive”. If a user stops interacting with the device, it will eventually power off, but if you wake the device and start using it again, you’re back to where you were. But when your original question talks about a “session will expire”, that only makes sense in context of the backend session servicing the user, not of the native app, itself. – Rob Dec 26 '20 at 16:45
  • I might suggest that you edit your question to include more debugging details, showing us the specific errors you are receiving. This is a bit unclear. – Rob Dec 26 '20 at 16:49