Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit e6f4b4d

Browse files
#170 Need a way to unregister push notification from Firebase
1 parent e9d21d5 commit e6f4b4d

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
[Firebase Android SDK Changelog](https://firebase.google.com/support/release-notes/android)
55

66

7+
## 5.1.3 (2018, January XX)
8+
9+
### New
10+
11+
- [#170](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/issues/170) Need a way to unregister push notification from Firebase
12+
13+
714
## 5.1.2 (2018, January 8)
815

916
### Fixes

src/firebase.android.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,10 @@ firebase.addOnPushTokenReceivedCallback = callback => {
470470
});
471471
};
472472

473+
firebase.unregisterForPushNotifications = () => {
474+
return Promise.reject("Not supported on Android");
475+
};
476+
473477
firebase.getRemoteConfigDefaults = properties => {
474478
let defaults = {};
475479
for (const p in properties) {

src/firebase.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -891,6 +891,8 @@ export function addOnPushTokenReceivedCallback(onPushTokenReceived: (data: strin
891891

892892
export function getCurrentPushToken(): Promise<string>;
893893

894+
export function unregisterForPushNotifications(): Promise<void>;
895+
894896
// dynamic links
895897
export function addOnDynamicLinkReceivedCallback(onDynamicLinkReceived: (callBackData: dynamicLinks.DynamicLinkCallbackData) => void): Promise<any>;
896898

src/firebase.ios.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ firebase.addOnPushTokenReceivedCallback = callback => {
320320
});
321321
};
322322

323-
firebase.unregisterForPushNotifications = callback => {
323+
firebase.unregisterForPushNotifications = () => {
324324
return new Promise((resolve, reject) => {
325325
try {
326326
if (typeof(FIRMessaging) === "undefined") {

0 commit comments

Comments
 (0)