mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-22 01:19:36 +08:00
docs(fcm): improve example
docs(fcm): improve example
This commit is contained in:
commit
a3f63a61b9
@ -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);
|
* backend.registerToken(token);
|
||||||
* })
|
* });
|
||||||
*
|
*
|
||||||
* fcm.onNotification().subscribe(data=>{
|
* this.fcm.onNotification().subscribe(data => {
|
||||||
* if(data.wasTapped){
|
* if(data.wasTapped){
|
||||||
* console.log("Received in background");
|
* console.log("Received in background");
|
||||||
* } else {
|
* } else {
|
||||||
* console.log("Received in foreground");
|
* console.log("Received in foreground");
|
||||||
* };
|
* };
|
||||||
* })
|
* });
|
||||||
*
|
*
|
||||||
* fcm.onTokenRefresh().subscribe(token=>{
|
* this.fcm.onTokenRefresh().subscribe(token => {
|
||||||
* backend.registerToken(token);
|
* backend.registerToken(token);
|
||||||
* })
|
* });
|
||||||
*
|
*
|
||||||
* fcm.unsubscribeFromTopic('marketing');
|
* this.fcm.unsubscribeFromTopic('marketing');
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
* @interfaces
|
* @interfaces
|
||||||
|
Loading…
Reference in New Issue
Block a user