Follow the below steps to create the example app:
- Now, create a new MyiOSPush app using the blank template, as shown, and go to the MyiOSPush folder:
$ ionic start MyiOSPush blank $ cd MyiOSPush
- Install the Cordova plugin and Ionic Native wrapper for OneSignal:
$ ionic cordova plugin add onesignal-cordova-plugin$ npm install --save @ionic-native/onesignal
We need to add this ionic-native plugin to app.module.ts.
- We also need to install cocoapods. Go to Terminal, and install it as follows:
sudo gem install cocoapodspod repo update
- Open and edit ./src/app/app.module.ts with the following content:
import { BrowserModule } from '@angular/platform-browser';import { ErrorHandler, NgModule } from '@angular/core';import { IonicApp, ...