Hi Sujan, the very first thing that happens in the app is that it checks the production channel for updates. If we didn’t check the production channel first and there were any bugs prior to using the Deploy service, then a buggy push to the cloud would brick the app and it couldn’t be fixed.
However, the problem with checking the production channel as the very first step is that we don’t know who the user is yet (they haven’t logged in). We also want to be able to let the user log in, then check if they’re a “beta” user who should get a special release of the app to test new features. That way we can do controlled releases of new versions of the app.
But if you do the check on separate channels you then get into an infinite loop. I contacted Ionic support and they wrote this:
"I’ve chatted with one of our developers about this, and it sounds like you could potentially accomplish what you’re looking for, but it might take some creativity.
Essentially, Deploy’s channels weren’t conceived with the intention of an individual device switching from one channel’s updates to another. The app knows if a new update is available by checking the designated channel for an active deploy, then checking that deploy’s version number against the installed version on the device. However, the version number is the same, regardless of channel, so that might cause some issues with the way you’re trying to build this. "
I figured out a work around. Basically I first check on the production channel. Then when the user logs in and is marked as a “beta” user, I check for updates on the beta channel. I then write the channel name to localStorage. WHen the app starts again, it checks if there’s a channel in localStorage and if there is it uses that instead of the production channel. This at least removes the infinite loop. Not ideal (ideal would be for the server to only tell you there was an update based on timestamp) but it works