docs(fcm): improve example

docs(fcm): improve example
This commit is contained in:
Daniel Sogl 2018-03-17 01:24:42 +01:00 committed by GitHub
commit a3f63a61b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,25 +31,25 @@ export interface NotificationData {
*
* ...
*
* fcm.subscribeToTopic('marketing');
* this.fcm.subscribeToTopic('marketing');
*
* fcm.getToken().then(token=>{
* this.fcm.getToken().then(token => {
* backend.registerToken(token);
* })
* });
*
* fcm.onNotification().subscribe(data=>{
* this.fcm.onNotification().subscribe(data => {
* if(data.wasTapped){
* console.log("Received in background");
* } else {
* console.log("Received in foreground");
* };
* })
* });
*
* fcm.onTokenRefresh().subscribe(token=>{
* this.fcm.onTokenRefresh().subscribe(token => {
* backend.registerToken(token);
* })
* });
*
* fcm.unsubscribeFromTopic('marketing');
* this.fcm.unsubscribeFromTopic('marketing');
*
* ```
* @interfaces