mobify-progressive-app-sdk3.0.6 • Public • Published
▓ ▄▓▓▓▌ ▓▓▓▓▓▌ ▓▓▓▓▓▓▓▌ ▄▓▓▓▓▓▓▓▓▓▄▄▄▄ ▄▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▄ ▄▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▄ ▄▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█▓▓▓▓▓ ▓▓▓█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▄▀▓▓▓▓▄ ▓▀▀ ▐▓▓▓▓██▀▀▀█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░█▓▓▓▄ ▐▓ ▀▀ █▓▓▓▓▓▓▓▓▓▓▓▓▓▌ ▓▓▓▓▄ ▓ ▀▓▓▓▓▓▓▓▓▓▓▓▓▄▓▓▓▓▓▓▓▄▄▄▄ ▓▌ ▀▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█ ▐▌ █▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█▀ ▐▌ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█▀ ▐▌ ▄▄▓▓▓▓▓▓▓▓▓▓▓▓▓▓█▀ ▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▀ ▓ ▓█▀▀ ▀█▓█▀ ▐▌ ▐ ▓ ▓ ▐▓ ▀▄ ▄▀ ▀▒▄▄ ▄▄▄▀▀▄▄▄▀▀ ▀▀▒▄▄▄▄▄▄▒▀▀▀ █████╗ ███████╗████████╗██████╗ ██████╗ ██╔══██╗██╔════╝╚══██╔══╝██╔══██╗██╔═══██╗ ███████║███████╗ ██║ ██████╔╝██║ ██║ ██╔══██║╚════██║ ██║ ██╔══██╗██║ ██║ ██║ ██║███████║ ██║ ██║ ██║╚██████╔╝ ╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝
An SDK that makes it easy to leverage native or web UI for building amazing iOS and Android apps.
Table of Contents
The documentation is organized by Astro release in folders.
docs/public/ contains one folder for
each release of Astro plus a special
dev folder for changes related to an unreleased version of
Astro. See the release checklist for more information.
You can create "perma-links" to the latest version of Astro documentation by using http://astro.mobify.com/latest/.
We use Harp to build our docs. Harp is an npm dependency and so is installed when you run
npm install in the root of the Astro repo.
Most of our documentation is written in markdown. Changes to
any tutorials or reference guides should be changed in
To preview your changes, run the following:
$ npm run docs:serve
Then browse to
The Astro documentation is hosted on S3 at http://astro.mobify.com.s3-website-us-east-1.amazonaws.com, which is the origin for http://astro.mobify.com.
All Astro documentation is published every time a pull request is merged into the
Should you need to deploy the docs manually, docs, you will need permission to deploy to the
astro.mobify.com S3 bucket (ask in #it on Slack). If you have the correct permissions, ensure
AWS_SECRET_ACCESS_KEY environment variables are set, and run the following
to deploy the updated docs site:
$ npm run docs:upload
Clone the repo:
git clone email@example.com:mobify/astro.git
- We recommend using nvm to manage node and npm versions.
- node ^8.10.0 LTS
- npm ^5.0.0
- Grunt CLI - Install via
npm install -g grunt-cli
- Java Development Kit (JDK) 8
- Android Studio
- Install npm dependencies (push libraries) by running:
- Download and install Android Studio.
Open an existing Android project, and select the
astro/sandbox/androidfolder. Android Studio will open both the Astro Android source code and the Sandbox Android app source code.
- Create an Android Virtual Device if you haven't already.
- Follow these instructions to install SDK packages.
- Run the Sandbox app!
- Download and install Xcode
open sandbox/ios/Sandbox.xcworkspacein your Terminal. It will open both the Astro iOS source code and the Sandbox iOS app source code.
- Run the Sandbox app!
How to create and ship a change
In order to ship a change to Astro, follow our Contributing guidelines.
- Install the dependencies needed for testing, run
- To run the tests on the command line, run
- To run the tests in the browser, run
- Start the server required for testing by running
npm run fixture-server
- In Xcode, select the "Astro" workspace in the workspace dropdown.
- Go to Product -> Test (⌘U)
- Go to Run -> Edit Configurations
- Click on the "+" on the top left, and select "Android Tests"
- Label it "Astro Tests", choose the module "astro", and click OK.
- Select "Show chooser dialog"
- In the drop down next to the green play button, select "Astro Tests" and click the play button.
- Watch the tests run!
The testing framework we use is jUnit 3.
The mocking library we use is Mockito.
Run the following command to generate the test coverage report:
cd android; ./gradlew createDebugCoverageReport
Then, open the report index.html file to have a look at the coverage:
Currently we are not measuring test coverage in iOS :(
Currently we are not measuring test coverage in JS :(
Publishing a new version
The release process for Astro (and dependent projects) is outlined in RELEASE.md.
android/- Contains the source code for the Astro Android library
ios/- Contains the source code for the Astro iOS library
sandbox/- Contains the source code for the demonstration sandbox (aka Catalogue).
When you're developing an Astro application, there are a few key pieces of JS to know about:
- webViewPlugin.js, drawerPlugin.js, and other plugins
app.js is your main entry point to developing an Astro project. This is where the main business logic of you application lives. The app logic is handled in a persistent WebView that lives throughout the lifecycle of your application (otfen referred to as "the worker"). It's also the place where you import/require modules (controllers, plugins, etc.) that you need for your application.
app.js lives inside of
You can learn more about how to build and develop the sandbox here.
astro-client.js is the library which provides the ability for web views to communicate with app.js.
astro-full.js is the library which provides the ability for app.js to communicate with native Astro components. It's the library that SDK plugin developers should import in order to create a plugin.
All plugins can be found inside of
You can learn more about how to build and develop Astro plugins