Reconnect API
Add a "Try again" button to your offline fallback page that reloads the last online URL of your iOS app.
The Reconnect API reloads the last online URL the user was on before your app fell back to the offline HTML page. It is designed as a "Try again" button on your custom offline / fallback screen.
How to Use:
Add the trigger to your offline page (typically local-html/index.html):
<button onclick="window.location.href='reconnect://'">Try to reconnect</button>
How It Works:
The app remembers the last URL that was loaded successfully. When the user taps reconnect://, the WebView navigates back to that URL. If connectivity is still down, your fallback page is shown again.
Related Config:
offlinelocalhtmlswitchin Config.swift must be set totrue, and you need alocal-html/index.htmlfallback page for this feature to make sense. See Set up your web app for details on the offline fallback mode.