Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Commit 72ca630

Browse files
committed
Added functionality to unsubscribeFromTopic
1 parent ae4f9fd commit 72ca630

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotification.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@ public void requestPermissions(String senderID) {
145145
public void subscribeToTopic(String topic) {
146146
FirebaseMessaging.getInstance().subscribeToTopic(topic);
147147
}
148+
149+
@ReactMethod
150+
public void unsubscribeFromTopic(String topic) {
151+
FirebaseMessaging.getInstance().unsubscribeFromTopic(topic);
152+
}
148153

149154
@ReactMethod
150155
public void presentLocalNotification(ReadableMap details) {

index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,10 @@ Notifications.subscribeToTopic = function() {
280280
return this.callNative('subscribeToTopic', arguments);
281281
};
282282

283+
Notifications.unsubscribeFromTopic = function () {
284+
return this.callNative('unsubscribeFromTopic', arguments);
285+
};
286+
283287
Notifications.presentLocalNotification = function() {
284288
return this.callNative('presentLocalNotification', arguments);
285289
};

0 commit comments

Comments
 (0)