MOBILE-2567 core: Fix local notification events
parent
ba46373873
commit
b67a2900eb
|
@ -122,7 +122,7 @@
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
|
<plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
|
||||||
<plugin name="cordova-plugin-zip" spec="^3.1.0" />
|
<plugin name="cordova-plugin-zip" spec="^3.1.0" />
|
||||||
<plugin name="cordova-plugin-local-notifications-mm" spec="^1.0.10" />
|
<plugin name="cordova-plugin-local-notifications-mm" spec="^1.0.11" />
|
||||||
<plugin name="cordova-plugin-file-opener2" spec="^2.0.19" />
|
<plugin name="cordova-plugin-file-opener2" spec="^2.0.19" />
|
||||||
<plugin name="com-darryncampbell-cordova-plugin-intent" spec="^1.1.0" />
|
<plugin name="com-darryncampbell-cordova-plugin-intent" spec="^1.1.0" />
|
||||||
<plugin name="cordova-sqlite-evcore-extbuild-free" spec="^0.9.7" />
|
<plugin name="cordova-sqlite-evcore-extbuild-free" spec="^0.9.7" />
|
||||||
|
|
|
@ -125,17 +125,19 @@ export class CoreLocalNotificationsProvider {
|
||||||
this.appDB = appProvider.getDB();
|
this.appDB = appProvider.getDB();
|
||||||
this.appDB.createTablesFromSchema(this.tablesSchema);
|
this.appDB.createTablesFromSchema(this.tablesSchema);
|
||||||
|
|
||||||
localNotifications.on('trigger', (notification, state) => {
|
platform.ready().then(() => {
|
||||||
this.trigger(notification);
|
localNotifications.on('trigger', (notification, state) => {
|
||||||
});
|
this.trigger(notification);
|
||||||
|
});
|
||||||
|
|
||||||
localNotifications.on('click', (notification, state) => {
|
localNotifications.on('click', (notification, state) => {
|
||||||
if (notification && notification.data) {
|
if (notification && notification.data) {
|
||||||
this.logger.debug('Notification clicked: ', notification.data);
|
this.logger.debug('Notification clicked: ', notification.data);
|
||||||
|
|
||||||
const data = textUtils.parseJSON(notification.data);
|
const data = textUtils.parseJSON(notification.data);
|
||||||
this.notifyClick(data);
|
this.notifyClick(data);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
eventsProvider.on(CoreEventsProvider.SITE_DELETED, (site) => {
|
eventsProvider.on(CoreEventsProvider.SITE_DELETED, (site) => {
|
||||||
|
|
Loading…
Reference in New Issue