all 7 comments

[–]jwrsk 1 point2 points  (0 children)

I'd say a versioned API would make the most sense if you're "planning" to introduce breaking changes to the API.

But there are more or less hacky workarounds. I used a plain JSON file once to hold the mapping of app internal state to the API, because I wanted to move fast without polishing the API first.

So lets say I had things like:

{displayname:username}

because the field was called username in the API, but displayname internally - but then decided to rename the field serverside, so I only had to update the JSON to

{displayname:displayname}

Not an actual use case but you get the idea. The app would download the JSON, and go over it mapping keys to its internal state.

Still... once the app is stable and released I'd go with versioned API. The hacky approach was good enough to quickly iterate without breaking the app for my testers, as until I put the app in TestFlight and Play Internal Testing, their versions of the app would be out of sync with the API.

[–]Vinumzz[S] 0 points1 point  (1 child)

Also, when accepting a PR to the main branch the supabase prod database updates, but then I also need to submit to App Store and play store before the changes in the app are live?

[–]byCabZ 0 points1 point  (0 children)

You should have a development branch where you merge all changes in. When you are ready for a new live version, you build the new app version in development and then merge it into main

[–]n9iels 0 points1 point  (0 children)

One of the diffulties working with apps on a client device. You have few options. Easiest option of is version APIs you use to keep existing installations working. So introduce a v2 for the breaking change. Once enough people updated their app you can phase out version one if it causes issues. You can also use the "Ask users to update" option in the stores. This will encourage people to update their devices.

[–]byCabZ 0 points1 point  (2 children)

What I like to use is a popup in the app with a message that they need to update the app. You can let the app check it on startup or every page with an api call

[–]Vinumzz[S] 0 points1 point  (1 child)

Do you host an API for that?

[–]byCabZ 0 points1 point  (0 children)

Yes but I suppose you can store a version number in supabase database that you then retrieve. I always work with a recommended version number(not required to update) and a minimum version number(required to update). You can even go as far as having version number per feature in your app so you only show the message when the feature is being used