|
|
|
|
|
by bcroesch
4770 days ago
|
|
Good call. Admittedly, I put this together very quickly yesterday when we ran into the issue of wanting to share a link. Would be nice if you could somehow avoid rendering a whole page, but I can't think of anything off the top of my head that would allow you to do that. |
|
An alternative hacky method to avoid the web page is to redirect the browser to a JavaScript URL. However, this results in a momentary error popup, though it's automatically dismissed. And the user is still navigated to the backup URL when Safari returns to the foreground in the future.
For example: javascript:window.location = 'app-schema://'; window.setTimeout(function() { window.location = 'http://app-url; }, 10);
EDIT: After thinking about it, since timers are suspended when Safari enters the background, you can probably use setInterval and check how long it's been to decide whether the browser should navigate to the backup URL. The error popup remains a problem, however.