Little Mobile Lifesavers (i.e. Pull-to-refresh)

First of all, Thank you very much! I didn’t know about some of these tips and will definitely use them.

This is great timing because I resolved some issues of mine and would like to share!

Prevent Polling When Application is in the background (Not Visible):

This always you to still have all your polls available, but make sure they are not called and raise the AppOfflineError when your appis in the background.

Raise FormShow() When Mobile Application is brought to the foreground:

I recently ran into an issue where my expectations did not match reality. The form_show event does not raise when the mobile device is brough back to the foreground. To resolve this, you can the following event handler:

window.addEventListener('visibilitychange',self.form_show)
Note this will call form_show when the application is hidden and shown, so you’ll have to check visibilty if you do not want it to be called on being put in the background (you can you the wrapper linked )
5 Likes