Handling versioning and updating an application

Hi everyone,

I labeled this post as “ionic” but it really is broader than that.
This is more of a best practice/guideline advice than a question:

What do you guys and gals do to handle your app updates?
I’m talking about your own code, NOT the framework, or cordova or any dependencies or even app/play store related features.

Let me explain with a typical hybrid application that rely on a backend server.
You have your app up and running in the store, already hundreds of users.

In the new update you want to publish, there are several new features.
However you want some part of your new code to only be triggered once after the app has been updated. for example, a guide for new users, or a “what’s new” banner.
The first-tour guide would obviously appear only once after the app has been installed and the changelog banner would appear every-time the app has been updated.
I figured you should store the version number, compare it each time you launch the application and do stuff based on the update status.

This is all possible to do by hand but I find it strange that there are not a single library to handle just that.
Something that would check the app version, trigger an event and you would just have to act on it.
This pattern is becoming quite common on web application: relying on local storage to sync, store and compare local information with remote.
EDIT: I found ngStorage to be interesting but it’s just about reading/writing storage, nothing about checking version numbers.

What do you think ?
Does Ionic provide something to ease that process ?

Thanks for the awesome framework !

PS: Despite the very similar title, this post does not cover the same topic as Handling app updates

1 Like

That’s exactly what I do.

This is all possible to do by hand but I find it strange that there are not a single library to handle just that.

Maybe because it’s easy enough to do by hand and each app needs to do slightly different things so it’s difficult to provide a generic library? Just I guess. In fact there may well be libraries out there, I’ve never actually looked for one.

Client side updates don’t scare me as much as server side.

I am actually to the point where I will have to start thinking about that. I’m wondering if sending the client version number to the server in a header maybe, and then doing a switch case off that to keep compatibility. If I were doing this I would only keep the last version of compatibility so that you could obviously give users a chance to switch over to the new version…

I hope we can get some good answers in this thread! Anyone else had success/failure with this?

That’s something I do as well, it’s very useful for tracking and stats anyway. However I realised that returning a different server response depending on the client version can become messy pretty quickly.

If I really need to do a breaking change I now tend to create a different endpoint altogether, e.g. using versioned URLs you could have a /v1/friends, then you can add a /v2/friends that returns a different response for new clients, while old clients will keep calling v1.

I also have a global “emergency” switch: when the app starts it makes a first call to the server passing the client version, and the server can return a “client too old” response, so the app will display a dialog telling the user “sorry, you must upgrade” and exit. I’ve only used it once though, cutting off people still using a version several months’ old.

1 Like

Ah okay. I am currently using Parse as my back end and I wonder how well I could implement something like that. I run all my calls through cloud code so I have a lot of control over those kinds of things.

And I figured that sometimes apps have to do that emergency thing. Every once in a while they gotta change something big haha.