I have a Touchkit UI that works perfectly when accessed using a bookmark. But it won’t load reliably when Apple’s Home Screen feature is used. The home screen icon on the iOS device brings up a blank screen. This happens after the application is changed and redeployed to the server. The iOS device looks for a previous version of the javascript and hangs when it’s no longer available. Re-creating the home screen icon doesn’t help - Apple devices remember the old data.
I’ve tried adding a Vaadin-Refresh comment in the TouchKitServlet but it hasn’t helped:
getService().addSessionInitListener(event -> event.getSession().addBootstrapListener(new BootstrapListener(){
private static final long serialVersionUID = 5106409177353379749L;
@Override
public void modifyBootstrapFragment(
BootstrapFragmentResponse response) {
// nothing needed here in this implementation
}
@Override
public void modifyBootstrapPage(BootstrapPageResponse response) {
// Cretate some special comment code to encourage cache refresh
Comment refreshCode = new Comment("Vaadin-Refresh", "");
response.getDocument().body().appendChild(refreshCode);
}
}));
Apple’s Home Screen implementation is the preferred way to go. Using a Safari or Chrome bookmark works, but it doesn’t use full screen - instead displaying the URL and footer bars.
Does anyone know how to force an iOS device to get the current Vaadin javascript every time?
Vaadin 7.4.2, Tomcat 8.0.20. Touchkit 4.0.0