0.0.10 • Published 5 years ago
@egoi/push-ionic v0.0.10
Installation
Basic setup
1. Install the plugin using NPM or Yarn
npm install @egoi/push-ionic
yarn add @egoi/push-ionic
2. Register the app and the device
import { EgoiPushIonicService } from '@egoi/push-ionic';
export class NotificationsService {
constructor(
private egoiPushService: EgoiPushIonicService
)
registerEgoiPush() {
this.egoiPushService.register({
apiKey: 'your api here',
appId: 'your app id here',
os: 'android|ios',
twoStepsField: 'the field to set on new/edit register (e.g. id, email) (optional)',
twoStepsValue: 'the field value to set on new/edit register (optional)',
deepLinkHandler: 'link handler to redirect the user on notification open (optional)',
notificationHandler: 'notification handler to work with the notification content (optional)'
});
}
registerDevice(user) {
this.egoiPushService.registerDevice('email', user.email).then((response) => {
// proccess the resolve
});
}
}