mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-21 00:23:00 +08:00
fix(fcm): add missing clearAllNotifications, hasPermission and getAPNSToken (#3331)
* fix(fcm): add missing clearAllNotifications * getAPNSToken method added New version of `cordova-plugin-fcm-with-dependecy-updated` released: v4.0.0 _“The old FCMPlugin.getToken is focused on retrieving the FCM Token. For the IOS, APNS token can now be retrieved by the new method”_ (Show readme)[https://github.com/andrehtissot/cordova-plugin-fcm-with-dependecy-updated#version-400-12102019] * hasPermission added [Show readme.md](https://github.com/andrehtissot/cordova-plugin-fcm-with-dependecy-updated#version-320-16092019) #### Checking for permissions Useful for IOS. On android, it will always return `true`. ```javascript FCMPlugin.hasPermission(function(doesIt){ // doesIt === true => yes, push was allowed // doesIt === false => nope, push will not be available // doesIt === null => still not answered, recommended checking again later if(doesIt) { haveFun(); } }); ``` # Conflicts: # src/@ionic-native/plugins/fcm/index.ts Co-authored-by: Alexis Caffa <AlexisCaffa@users.noreply.github.com>
This commit is contained in:
parent
7277c0fbe5
commit
18bee4e298
@ -53,6 +53,8 @@ export interface NotificationData {
|
||||
* }
|
||||
* })
|
||||
*
|
||||
* this.fcm.clearAllNotifications();
|
||||
*
|
||||
* this.fcm.unsubscribeFromTopic('marketing');
|
||||
*
|
||||
* ```
|
||||
@ -150,4 +152,14 @@ export class FCM extends IonicNativePlugin {
|
||||
onNotification(): Observable<NotificationData> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes existing push notifications from the notifications center
|
||||
*
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
@Cordova()
|
||||
clearAllNotifications(): void {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user