base-ionic v2.0.0
BaseIonic
This is a templete with some ommon codes for general aplications, this include general function of Firebase
Prerequisites
- Ionic CLI Version: >2.2.1
- Ionic App Lib Version: >2.2.0
- Cordova CLI: >6.5.0
- Node Version: >v7.3.0
- Create a proyect in Firebase
- Create a app in Facebook developers
- Create a count in Ionic Cloud
Instalation
Clone repository
$ git clone https://github.com/IWite/baseIonic.git
Install dependencies
$ npm install
Add plugin of Facebook with the credentials of your app in Facebook developers
$ ionic plugin add cordova-plugin-facebook4 --variable APP_ID="123456789" --variable APP_NAME="myApplication" --save
Install platform
$ ionic platform add android $ ionic platform add ios
initialize the app in ionic cloud
$ ionic io init
Configuration
- Set the config variables of firebase in
env/dev.json
andenv/prod.json
(Don't change the keyfirebase_config
)
{
"firebase_config": {
"apiKey": "",
"authDomain": "",
"databaseURL": "",
"projectId": "",
"storageBucket": "",
"messagingSenderId": ""
}
}
Environments
This project have two json where is possible to add variables to use in production or development environment.
To use diferents environtmens use --prod
for production and not put nothing for development
$ ionic serve
$ ionic serve --prod
Add ENV.data
varible in your component to use the environmet variable
...
declare const ENV;
...
constructor(public magicBall: MagicBall) {
console.log(ENV.data)
}
Unit Test
Now is possible to run unit test in ionic 2
$ npm test
All dependencies to create and run unit test were installed, you only need to create de unit test file:
Documentation
For generate a file with web page documentation run:
$ npm run docs
7 years ago