Read complete story

FCM in module dependencies

If you have an application and want to use this app (module) as a library for the other one with both supporting there own FCM then you are at the right place. One might get confused as we will not recreate or rewrite FirebaseInstanceIdService, both the applications will use the single Service that will be defined in the library module. The google-services.json file and the application Id for the project will do all the work for you.

You just have to provide their respective google-services.json files in main module folder as

directory_structure

But don’t for get to add the google-services plugin in build.gradle file of both the modules as this will cause the generation of tokens for only the one module that has this plugin. Many times we forgot to add this plugin to upper level module (i.e MainApplication) and end up with a Firebase Token of library module.

And you are ready to go and one more thing if you are using Topic messaging and just subscribed to a new topic then it will take atleast 3- 4 hours to appear in your Firebase console so there is nothing to worry. Thats all for today. Happy Coding!

. . .

Comment

Add Your Comment

Be the first to comment.

css.php
Hire Us!
Brief us about your requirements and we'll get back to you.
Woo! Hooy!
We have just recieved your project brief and our expert will contact you shortly.
Send Again
Close