This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@blinkmobile/evergreen-sdk

1.0.0-alpha.2 • Public • Published

Evergreen updater npm AppVeyor Status Travis CI Status Greenkeeper badge

A Module to handle getting and using an evergreen update made with the Blink Buildbots

Installation

npm i --save @blinkmobile/evergreen-sdk

Prerequisites

Usage

For iOS < 10 and older Android projects dist/bm-evergreen-updater-legacy.js should be used. This includes the WhatWG fetch pollyfil and is transpiled from ES6 to ES5. ES6 builds using import will include src/evergreen-updater.js

You must make sure the deviceready event from cordova has fired before using this plugin

const EvergreenUpdater = require('@blinkmobile/evergreen-sdk')

document.addEventListener('deviceready', function () {
  const eu = new EvergreenUpdater({ appId: 'appId', tenantId: 'blinkTenantId' })

  eu.check().then((updateAvailable) => {
    if (updateAvailable) {
      return eu.download().then(() => eu.restart())
    }
  })
})

API

Constructor (options: object)

  • options.appId: Your Cordova app id from config.xml
  • options.tenantId: Your Blink Mobile Tenant Id
  • options.ionicDeploy: The Ionic Deploy plugin (optional, will use window.IonicDeploy if not specified)
  • options.platformId: The cordova platform id (optional, will use cordova.platformId if not specified)

check () => Promise<boolean>

Resolves with true if an update is available, false if not

download (progressCB: function(stage: string, progress: number)) => Promise<void>

  • progressCB: called whenever Ionic Deploy reports progress. stage will be one of 'download' or 'extract', progress is the percent complete for that particular stage

Resolves on successful download, rejects if an error occurred

restart () => void

Applies the update and restarts the app

Package Sidebar

Install

npm i @blinkmobile/evergreen-sdk

Weekly Downloads

3

Version

1.0.0-alpha.2

License

ISC

Last publish

Collaborators

  • aaronroworth
  • blinkmobile-admin
  • kizaonline
  • mymattcarroll
  • simon_marklar