From af75b49aa45e485334ee0a1af3eb8bdfb3300bb4 Mon Sep 17 00:00:00 2001 From: KULDIP PIPALIYA Date: Fri, 2 Mar 2018 02:00:17 +0530 Subject: [PATCH 1/2] Update index.ts --- src/@ionic-native/plugins/fcm/index.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/@ionic-native/plugins/fcm/index.ts b/src/@ionic-native/plugins/fcm/index.ts index af5f0b5e3..9b371567c 100644 --- a/src/@ionic-native/plugins/fcm/index.ts +++ b/src/@ionic-native/plugins/fcm/index.ts @@ -31,13 +31,14 @@ export interface NotificationData { * * ... * - * fcm.subscribeToTopic('marketing'); + * this.fcm.subscribeToTopic('marketing'); * - * fcm.getToken().then(token=>{ + * this.fcm.getToken().then(token=>{ + * /* save your token on backend */ * backend.registerToken(token); * }) * - * fcm.onNotification().subscribe(data=>{ + * this.fcm.onNotification().subscribe(data=>{ * if(data.wasTapped){ * console.log("Received in background"); * } else { @@ -45,11 +46,11 @@ export interface NotificationData { * }; * }) * - * fcm.onTokenRefresh().subscribe(token=>{ + * this.fcm.onTokenRefresh().subscribe(token=>{ * backend.registerToken(token); * }) * - * fcm.unsubscribeFromTopic('marketing'); + * this.fcm.unsubscribeFromTopic('marketing'); * * ``` * @interfaces From b61c442fd2bf1e17882a8f9dd03690d99a8b3157 Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Sat, 17 Mar 2018 01:22:06 +0100 Subject: [PATCH 2/2] fix example --- src/@ionic-native/plugins/fcm/index.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/@ionic-native/plugins/fcm/index.ts b/src/@ionic-native/plugins/fcm/index.ts index 9b371567c..269937abb 100644 --- a/src/@ionic-native/plugins/fcm/index.ts +++ b/src/@ionic-native/plugins/fcm/index.ts @@ -33,22 +33,21 @@ export interface NotificationData { * * this.fcm.subscribeToTopic('marketing'); * - * this.fcm.getToken().then(token=>{ - * /* save your token on backend */ + * this.fcm.getToken().then(token => { * backend.registerToken(token); - * }) + * }); * - * this.fcm.onNotification().subscribe(data=>{ + * this.fcm.onNotification().subscribe(data => { * if(data.wasTapped){ * console.log("Received in background"); * } else { * console.log("Received in foreground"); * }; - * }) + * }); * - * this.fcm.onTokenRefresh().subscribe(token=>{ + * this.fcm.onTokenRefresh().subscribe(token => { * backend.registerToken(token); - * }) + * }); * * this.fcm.unsubscribeFromTopic('marketing'); *