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

Commit 3818900

Browse files
Adding ability to (un/)subscribe to topics at firebase #262 - iOS needs a prefix
1 parent a43252b commit 3818900

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

firebase.ios.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,6 +1578,9 @@ firebase.subscribeToTopic = function(topicName){
15781578
return;
15791579
}
15801580

1581+
if (topicName.indexOf("/topics/") === -1) {
1582+
topicName = "/topics/" + topicName;
1583+
}
15811584
FIRMessaging.messaging().subscribeToTopic(topicName);
15821585
resolve();
15831586
} catch(ex){
@@ -1596,6 +1599,9 @@ firebase.unsubscribeFromTopic = function(topicName){
15961599
return;
15971600
}
15981601

1602+
if (topicName.indexOf("/topics/") === -1) {
1603+
topicName = "/topics/" + topicName;
1604+
}
15991605
FIRMessaging.messaging().unsubscribeFromTopic(topicName);
16001606
resolve();
16011607
} catch(ex){

0 commit comments

Comments
 (0)