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

Commit 4dff707

Browse files
committed
Enable using of topics in Android
Enable using of topics in Android
1 parent ceedc07 commit 4dff707

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

firebase.android.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,6 +1487,11 @@ firebase.subscribeToTopic = function(topicName){
14871487
return new Promise(function (resolve, reject) {
14881488
try{
14891489

1490+
if (typeof(com.google.firebase.messaging) === "undefined") {
1491+
reject("Uncomment firebase-messaging in the plugin's include.gradle first");
1492+
return;
1493+
}
1494+
14901495
if (firebase.instance === null) {
14911496
reject("Can be run only after init");
14921497
return;
@@ -1504,6 +1509,11 @@ firebase.subscribeToTopic = function(topicName){
15041509
firebase.unsubscribeToTopic = function(topicName){
15051510
return new Promise(function (resolve, reject) {
15061511
try{
1512+
1513+
if (typeof(com.google.firebase.messaging) === "undefined") {
1514+
reject("Uncomment firebase-messaging in the plugin's include.gradle first");
1515+
return;
1516+
}
15071517

15081518
if (firebase.instance === null) {
15091519
reject("Can be run only after init");

0 commit comments

Comments
 (0)