The old class for retrieving tokens is deprecated. Let’s look at the newer one. Learn how To Get an FCM Device Token in Android (Updated for 2021).
I really don’t like it much when there is some task to do with a deadline and there’s old code everywhere and all of it is deprecated, resulting in no specific answers online.
That’s when you work for the community and not for any job.
Directly coming to the point: Google deprecated Firebase's FirebaseInstanceIdService
class and I didn’t know that (until last night) as the last time I wrote an FCM service was a year and a half ago. The application code base I got to modify in order to fetch the FCM device token had the deprecated class, and I recognized it as a correct one. Actually, there were two code bases I got, and both had the same non-working service class.
I looked online for answers but no luck. Then I read a comment on a question on Stack Overflow about FirebaseInstallations
, and that’s when the fun started.
I knew the functions but not how to reach there: FirebaseInstallations
was the way. I tried different methods in it and got the whole thing working.
Request a free quote for custom web and mobile apps development, Enterprise solutions, IoT Solutions, AR/VR Development, Blockchain and chatbot services. Feel free to get in touch.
AppClues Infotech is a top Mobile App Development Company in USA building high-quality Android, iOS, and Native apps for Startups, SMBs, & Enterprises. Contact us now!
AppClues Infotech is a top Mobile App Development Company in USA building high-quality Android, iOS, and Native apps for Startups, SMBs, & Enterprises. Contact us now!
AppClues Infotech is a top Mobile App Development Company in USA building high-quality Android, iOS, and Native apps for Startups, SMBs, & Enterprises. Contact us now!
This blog provides quick analysis to decide whether to opt for Kotlin or React Native to build robust and secure mobile application.