IonPush - Live Deploy Updates for Ionic apps
IonPush allows us to publish changes and hot updates to our hybrid mobile applications without recompile the app and resubmit to app stores review process. This is very useful for publishing bug fixes, integrate A/B tests, changes of your UI/UX, content or business logic but only based on web technologies. Therefore it is important to know that the only changes which can be updated via the IonPush-platform immediately are changes to the view (HTML), business logic (Javascript), assets (for example images in the www
folder) and styling (CSS).
It excludes any changes to the native binary, such as the native plugins (Cordova Plugins), config.xml
or native images (icons, splash screens, etc). For these changes, the app has to be recompiled and has to go through the app stores to be updated for all end users. As a consequence it is important to add all necessary plugins ( also for your future features) to your app before your initial release in the app store.
This is mostly interesting for iOS Ionic apps, because the app review process of Apple is not only slow but also annoying. The reviewer has no interest in understanding your business logic and the use cases of your apps. As a result you are not able to update minor issues or updates of your API and lose your customers.
Another interesting and powerful use of IonPush is A/B testing feature. As we like, we can create different channels for testing with several variations of our web-app/code in parallel.
IonPush is nearly the same as the Ionic Deploy platform - but with one big difference: you can pay your live updates on demand. For example you are still in need of 3000 live updates until the end of the month. Ionic Deploy platform needs a subscription upgrade from 42$ to more than 100$. IonPush enables you to pay just 10$ for your required live updates. Also there is no subscription or other hidden costs at IonPush. If you will not provide your apps in the future, you can just stop the rollout process. There is no need in canceling any kind of contract.
Also you are able to deactivate and activate the live updates for a channel manually. Therefore you are able to build new features and upload the new versions before your release day. On your release day (e.g. Christmas) you are able to activate the roll out of your channel again and, as a consequence, your customers will receive your update.
As a result there are a lot of charts about your updates during the last months and also live updates. Now you have the ability to verify when a new update will be rolled out to your customers.
How it works
Register on the IonPush platform: https://ionpush.appit-online.de
Create a new App
Step 1
Click on "Create App" Button
Step 2
Enter the name of your app
Step 3
Copy your "App Identifier". This will be used for rolling out your updates to your customers and is needed to be configured out in your plugin settings.
Install Plugin
Actually there are two plugin versions which can be supported - 4 and 5. The difference is that version 4 rolls out the whole version of your app. In version 5 the only difference of files are updated on the client side. Therefore the usability and the latency in version 5 is better.
For the installation execute the following snippet with your APP_ID and CHANNEL_NAME in your terminal (root directory of your app)
cordova plugin add https://github.com/appit-online/appit-ionic-plugin.git --save \
--variable APP_ID="REPLACE_WITH_APP_IDENTIFIER" \
--variable CHANNEL_NAME="Production" \
--variable UPDATE_METHOD="background" \
--variable UPDATE_API="https://build.appit-online.de" \
--variable WARN_DEBUG="false"
The config will be added to your config.xml. If not, execute:
cordova plugin save
UPDATE_METHOD: `auto`, `background`, or `none`. Dictates the behavior of the plugin.
auto will download and apply the latest update on app start, potentially leading to long splash screen loads if the connection is slow.
background (default) will only download the update in the background on app start, but will allow full functionality while doing so, only redirecting users the _next_ time the app is loaded.
none will do nothing, leaving full plugin functionality in the hands of the developer.
Build and Upload your new App Version
Pre-Condition
The Plugin is installed and active. So local changes are ignored. During the development the plugin can be uninstalled. Be careful to reinstall it before you execute the following build steps.
Step 1
First we need to clean our build folders from development files. For this change directory to your root of your app
cd myApp
yes | rm -rf www/*
Step 2
Build your app for production
ionic cordova build ios --prod
Step 3
Archive your new app version
cd www
zip -r ../myapp.zip ./* -x "*.DS_Store"
Step 4
Upload your zip file via IonPush UI and wait until new version is ready for roll out
Migrate from Ionic to IonPush
Step 1
Add the following code to your app and deploy it to Ionic.
Step 2
Your users will change the update server to IonPush with their next Ionic update
Step 3
Create and Upload new app releases with IonPush
import {Pro} from '@ionic-native/pro';
constructor(private pro: Pro) {}
ngOnInit() {
if(window.localStorage.getItem( 'newServerMigration') != 'true'){
this.changeDeploymentServer();
}
}
changeDeploymentServer() {
const config = {
'appId': 'YOUR IonPush APP ID', // Your App Identifier from IonPush
'channel': 'Production', // Your new channel name
'host': 'https://build.appit-online.de'
}
this.pro.deploy().init(config)
.then((res: any) => {
window.localStorage.setItem( 'newServerMigration', 'true');
})
.catch(err => {
console.log(JSON.stringify(err));
});
}
Conclusion
IonPush is a really powerful platform and highly recommended for hot updates and managing channels for deployments - with a better payment model. Actually there are still some open issues, like the untested support of Android updates, but Android releases are not so annoying like for iOS, so I think this is not a big issue.
IonPush is developed from Developers for Developers and this is important.