diff --git a/src/@ionic-native/plugins/fcm/index.ts b/src/@ionic-native/plugins/fcm/index.ts index 87d5bf7b3..bdb8f132d 100644 --- a/src/@ionic-native/plugins/fcm/index.ts +++ b/src/@ionic-native/plugins/fcm/index.ts @@ -47,6 +47,12 @@ export interface NotificationData { * backend.registerToken(token); * }); * + * this.fcm.hasPermission().then(hasPermission => { + * if (hasPermission) { + * console.log("Has permission!"); + * } + * }) + * * this.fcm.unsubscribeFromTopic('marketing'); * * ``` @@ -62,6 +68,16 @@ export interface NotificationData { }) @Injectable() export class FCM extends IonicNativePlugin { + /** + * Gets ios device's current APNS token + * + * @returns {Promise} Returns a Promise that resolves with the APNS token + */ + @Cordova() + getAPNSToken(): Promise { + return; + } + /** * Gets device's current registration id * @@ -108,6 +124,19 @@ export class FCM extends IonicNativePlugin { return; } + /** + * Checking for permissions on iOS. On android, it always returns `true`. + * + * @returns {Promise} Returns a Promise: + * - true: push was allowed (or platform is android) + * - false: push will not be available + * - null: still not answered, recommended checking again later. + */ + @Cordova() + hasPermission(): Promise { + return; + } + /** * Watch for incoming notifications *