This can be used as base template for Ionic 2 Push apps. It's working for both iOS and Android Push Notifications.
-
Clone this repository
-
Install Ionic, cordova and node_modules
$ npm install -g ionic $ sudo npm install -g [email protected] $ npm install
-
Generate SENDER_ID using this tutorial ๐
-
Replace YOUR_SENDER_ID in config.xml and app.ts with above SENDER_ID
$ ionic platform add android
$ ionic build android
$ ionic run android
$ ionic platform add ios
$ ionic build ios
Run using XCode
####Use device token printed in console for push notifications using below server code
Push Notifications Server code ๐๐ It has server code used to send Push Notification to iOS and Android device.
ionic2-push-base/
|-- src/
| |-- app/
| | โโโ app.ts
| | โโโ app.module.ts
| | โโโ main.dev.ts
| | โโโ main.prod.ts
| |
| |-- pages/ * Contains all of our pages
โ โ โโโ details/ * Push Details tab page
โ โ โ โโโ detail.html * DetailsPage template
โ โ โ โโโ detail.ts * DetailsPage code
โ โ โ
โ โ โโโ home/ * Home page
โ โ โ โโโ home.html * HomePage template
โ โ โ โโโ home.ts * HomePage code
โ โ โ
โ โ โโโ tabs/ * Tabs page
โ โ โ โโโ tabs.html * TabsPage template
โ โ โ โโโ tabs.ts * TabsPage code
โ โ โ
โ โโโ theme/ * App theme files
| | โโโ variables.scss * App Shared Sass Variables
| |
| |-- index.html
| |-- manifest.json
| |-- service-worker.js
|
โโโ .editorconfig * Defines coding styles between editors
โโโ .gitignore * Example git ignore file
โโโ LICENSE * MIT License
โโโ README.md * This file
โโโ config.xml * Cordova configuration file
โโโ ionic.config.json * Ionic configuration file
โโโ package.json * Defines our JavaScript dependencies
โโโ tsconfig.json * Defines the root files and the compiler options
โโโ tslint.json * Defines the rules for the TypeScript linter