For anyone wondering how to do it in cordova hybrid app:
go to index.js ->
inside the function onDeviceReady() write :
subscribe();
(It's important to write it at the top of the function!)
then, in the same file (index.js) find :
function subscribe(){
FirebasePlugin.subscribe("write_here_your_topic", function(){
},function(error){
logError("Failed to subscribe to topic", error);
});
}
and write your own topic here ->
"write_here_your_topic"