21st Chapter: Deploy and live updates

Source: Internet
Author: User

usually after we develop an app, we need to put them in the corresponding app store for download. During this time, the App store audits are required, including initial upload and update uploads. It takes a few days and a few more weeks, which is a nightmare for our fast product iterations and hotfix. Ionic provides a way to enable real-time updates when applications need to be updated without the need for App store audits. Of course, from a technical point of view, Web-based products (HTML+CSS+JS) can be done. But from a business point of view, it is necessary to abide by the rules of use of each store, that is to say, there are some limitations:

    • Initial submissions must be approved by the store and cannot be avoided.
    • When you add or remove plugin, you need to review it.
    • After the update, the app will not be able to implement live updates when there is a compile-time error, it needs to be repaired through the store to continue to use.
    • Basically, the following changes to the WWW folder are available for live updates.

Live updates is a service provided by the Ionic team, similar to ionic push and so on, currently ionic deploy service is free and subsequent attempts to charge the mode.

The steps are as follows:

1. Sign up in Ionic IO site.

2. Create one app in Ionic io site.

3. Create one app in local.

$ ionic start appname$ CD APPNAME

4. ADD the Platform Web client

Ionic Add Ionic-platform-web-client

The following error occurred:

You can run the following command to resolve the issue:

Bower Install--save-dev ionic-platform-web-clientionic Install Ionic-platform-web-client

If "Ionic is not defined" error occurs, the following code needs to be placed after "<script src=" Lib/ionic/js/ionic.bundle.js "></script>":

<script src= "Lib/ionic-platform-web-client/dist/ionic.io.bundle.js" ></script>

5. Initialize your app into Ionic IO

Note: Do not run this step more than once, or create a series of unexpected errors.

Ionic IO init

6. ADD Ionic Deploy Service

Ionic plugin Add Ionic-plugin-deploy

7. Implement it in your app

Run (function ($ionicPopup) {  var deploy = new Ionic.deploy ();
Deploy.setchannel ("Dev"); Deploy.watch (). Then (function () {}, function () {}, function (updateavailable) { if (updateavailable) { Deploy.download (). Then (function () { deploy.extract (). Then (function () { deploy.unwatch (); $ionicPopup. Show ({ title: ' Update Available ', subTitle: ' An update was just downloaded. Would restart your app to use the latest features? ', buttons: [ {text: ' No Now '}, { tex T: ' Restart ', ontap:function (e) { deploy.load (); } } ] } );}) );};

Update Info.plist for IOS 9 to add exclusion rules to has a workaround for ATS.

<key>NSAppTransportSecurity</key><dict> <key>NSExceptionDomains</key> <dict> <key>amazonaws.com</key> <dict> <key>nsthirdpartyexception Minimumtlsversion</key> <string>TLSv1.0</string> <key>nsthirdpar Tyexceptionrequiresforwardsecrecy</key> <false/> <key>nsincludessubdom ains</key> <true/> </dict> <key>amazonaws.com.cn</key&gt            ; <dict> <key>NSThirdPartyExceptionMinimumTLSVersion</key> <string&gt ;                  Tlsv1.0</string> <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> <false/> <key>NSIncludesSubdomains</key> <true/> &L T;/dict> </dict></dict>

8. Upload the new version of your app into Ionic Io:you could try multiple times because some kind of errors could be occur Red due to unstable service of Ionic deploy. Make sure the Deploy Env are same as what are coded in step 7.

Ionic upload--note "new version"--deploy=dev

9. Change something of your apps, and run above command to upload the changes to Ionic IO again.

Succeed, now can see the changes is pushed into mobile device without putting them into app store!

Cannot download the updates in mobile device, the error was "No such key from Aws.amazonaws.com". No solution till now.

Recommendation: deprecated

    • The Ionic deploy service is currently in beta, so it is not recommended to use this approach on production, nor is it recommended to use this method frequently for updates.
    • To implement live updates, you must now register your account with Ionic io, and in the first version you need to do some code-level configuration (bypassing the ATS mechanism for iOS 9 users).
    • Because the app we upload is stored on top of the AWS cloud, security and privacy are a point to consider.
    • Testing on the phone for a long time did not succeed, feel the current service is very unstable, so under the dev environment is not recommended .

Resources:

    • Announcing Ionic Deploy Alpha:deploy your APP without waiting!
    • What happens if you screw up an Ionic deployment
    • It ' s alive, get your ionic APP to update automatically
    • Ionic Deploy Service Quick Start

21st Chapter: Deploy and live updates

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.