I’m using Ionic Deploy. I want to give my users the option to update now or later, but I also want to require some snapshots to be used no matter what (e.g. the API is changing, and we want all users to get the latest snapshot that uses the new API).
To do so, I’m setting metadata on snapshots, e.g. required metadata to true.
Then, when checking if there are any snapshot updates available, I want to look at metadata and either force the new snapshot to be downloaded or let the user decide when to download the new snapshot.
My issue is that the Ionic deploy check() only returns true or false… no information on the available update.
getMetadata()'s source says this:
Fetches the metadata for a given snapshot. If no UUID is given, it will attempt to grab the metadata for the most recently known snapshot.
I don’t want the metadata of the currently installed snapshot. I want the metadata of the available snapshot. But, I have no way of getting the uuid of the available snapshot, so I have no way of knowing if the available update is required or not.
Is there a better way to handle required snapshots?
I was mistaken. Calling getMetadata() in check() returns metadata for the available snapshot. I was just confused by the documentation “grab the metadata for the most recently known snapshot”.
I have it working well where some snapshots get force-downloaded/extracted/reloaded based on metadata, and other snapshots are optional where the user can decide to download now or get reminded in an hour, and when downloaded they can decide to reload the app now or later.
I also have this as a second AngularJS app so JS errors in the primary app don’t prevent the Ionic Deploy app from doing its thing and using a new snapshot in that scenario.
Whoah, that means my code would have worked had I actually implemented setting the var to returned values instead of dummy data. Now I kind of want to fix that - unfortunately this is not my project any more