From b4c3aaf6224e07a1f3226a5edead784c008a1f70 Mon Sep 17 00:00:00 2001 From: Bledi Dalipaj Date: Fri, 19 Sep 2025 01:52:28 +0300 Subject: [PATCH] fix(types): update unregister method to include optional success and error callbacks --- README.md | 14 ++++++++++++-- types/index.d.ts | 5 ++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 732909132..340206779 100644 --- a/README.md +++ b/README.md @@ -2044,10 +2044,20 @@ You can disable autoinit on first run and therefore prevent an FCM token being a cordova plugin add cordova-plugin-firebasex --variable FIREBASE_FCM_AUTOINIT_ENABLED=false -**Parameters**: None +**Parameters**: + +- {function} success - (optional) callback function to call on successful execution of operation. +- {function} error - (optional) callback function which will be passed a {string} error message as an argument ```javascript -FirebasePlugin.unregister(); +FirebasePlugin.unregister( + function () { + console.log("Unregistered from FCM"); + }, + function (error) { + console.error("Error unregistering from FCM: " + error); + } +); ``` ### isAutoInitEnabled diff --git a/types/index.d.ts b/types/index.d.ts index 06bf28459..40ff1a8b8 100755 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -69,7 +69,10 @@ export interface FirebasePlugin { success: (value: boolean) => void, error: (err: string) => void ): void - unregister(): void + unregister( + success?: () => void, + error?: (err: string) => void + ): void setBadgeNumber( badgeNumber: number ): void