FirebaseMessaging.getToken() using python

Question:

I’m building a kivy app and almost got firebase cloud messaging working using the pyfcm
package from pypi.

What i’m stuck on is how to get the "registration token" that the firebase SDK creates on app install so that i have a registration token to send push notifications to.

There seems to be lots of info scattered around the net in regards to doing it using some other language other than "python", but python is all i know so i’m trying to work it out for that language.Any one have tips on how i go about that please ?

I can’t find a python package that has the FirebaseMessaging.getToken() in it which is what the firebase documentation keeps referring to, so i’m lost and my brain is going mushy now due to researching this for hours and hours so far 🙂

any help appreciated

Asked By: Lazza

||

Answers:

To answer my own question.

For those wondering the same question as i had. I came across this package https://github.com/Fox520/pushyy

In that package the guy has incorporated the ability to get the device token and also update the token when it changes. It takes a little manipulating to get the package to work properly with the latest gradle version but it is do able.

There doesnt seem to be a direct "python" method as such to get the token so using this package makes use of the required java and python code to achieve the task. Using this and using pyfcm from pypi to send messages, i’m now able to send firebase push notifications from my kivy app 🙂

Answered By: Lazza
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.