Reputation: 173
I have created a PWA which is validated by the Google Chrome Lighthouse
audit tool. On Android Phones the native "Add to Homescreen" prompt is displayed and on iOS, a custom "Add to Homescreen" prompt is shown.
The problem is that on iOS the PWA saves the session and I am not redirected to the "start_url".
I need an option to always direct users to the "start_url" if they close the app and reopen it afterward.
Here are the PWA files: https://www.ta-systems.net/BE-Utilities/pwc/test/
I have tried mentioned in the PWA documentation, however, I was not able to get the App to refresh every time it is restarted.
The complete code can be found here: https://www.ta-systems.net/BE-Utilities/pwc/test/
The expected result should be that the application redirects to a different HTML page after 5 seconds & once the app is closed and relaunched the "start_url" should be reopened.
What happens at the moment is the following:
Upvotes: 14
Views: 12241
Reputation: 434
What happened for your PWA is that it saved the session state after you closed it. Starting iOS 12.2, Apple fixed PWA so that it is able to keep PWA session state. However, there is still a problem that Apple needs to fix: it saves the state regardless if you minimize the app (by going to home screen) or close it (by swiping up on app-switch mode). According to this article (https://wespeter.com/posts/ios13-pwa-improvements/) Apple will be fixing in iOS 13 so that it starts your PWA from scratch (start_url) after force quit by swiping up, and only keeps the state when minimize to home screen without force quit and reopen.
Upvotes: 6
Reputation: 447
You need a valid web Manifest that indicates the start_url and other keys, the start_url on the manifest would instruct the app on the page to start with when launched.
Upvotes: -1