dotherightthing / gsheet-search

Mobile-friendly frontend to enable quick filtering of a Google Sheet.
2 stars 0 forks source link

Frequent unloading/refreshing of the app by iOS Safari #2

Open dotherightthing opened 1 year ago

dotherightthing commented 1 year ago

On iOS, Safari must be used because only the built-in browser can add a shortcut to the home-screen, and thus launch in app/full-screen mode.

However iOS Safari is proving too problematic with frequent unloading/refreshing of the app. Relaunching the app takes a few seconds that I simply don't have and is especially problematic in a lift with no data connection. This is annoying as I am using the app at most delivery points.

I need to fix Safari or develop a solution that doesn't run inside Safari.

Tweaking Safari

Change tab settings

https://discussions.apple.com/thread/2774294

changing Settings>Safari>Open New Tabs in Background to OFF, did it for me

As of OS8.1, this does not fix the problem on an iPad 2

Settings > Safari > Close Tabs > Manually

Alternative browser options:

No swap file in iOS

Also read somewhere that it's due to iOS not using a swap file, so the contents of memory can't be transferred on disk if the physical memory becomes full.

Allow caching

https://apple.stackexchange.com/questions/74797/can-i-force-a-cache-refresh-in-safari-running-on-ios

You can force the device to stop caching files by connecting it to a computer with a cable and enabling Safari developer mode.

Settings > Safari > Advanced > Web Inspector

I had this enabled, so perhaps caching was disabled?

Are other apps to blame?

At work I always have a number of apps open:

The phone is also constantly alternating between being put to sleep and woken.

And Bluetooth headphones are attached to get Gmail notifications (Gmail is closed).

Reload seems to happen after closing other apps.

Alternative to Safari

Load the data into a native app

Google Apps Script API Executable

I build web apps because I know how to build websites. But the web app only requests data on load, thereafter it uses the exported JSON.

Google Apps Script offers deployment as a 'Web app' - or as an 'API Executable'.

The API Executable could download the sheet as JSON, but be called from a native app rather than an Apps Script app.

The problem is that an API Executable needs to use a Standard Cloud Project and this might cost something ("If you are a free trial user.."). The cost calculator is super complex and I've already been advised that my free trial has ended but I have no idea which of my projects that will affect.

SheetsOn

https://sheetson.com/ offers an API for consuming Google Sheets.

While I would prefer to use the knowledge I already have (Apps Script), SheetsOn could be a good way to get up and running quickly.

dotherightthing commented 1 year ago

Links: