FCM Client 0.2.2 documentation.

Python client for Firebase Cloud Messaging (FCM).

The GCM library was originally written by Sardar Yumatov. It seems to have been abandoned around 2015 or 2016. When google announced the move to Firebase, there was a need for a updated version of this software.

Requirements

  • requests - HTTP request, handles proxies etc.

Alternatives

Th only alternative library known at the time of writing was pyfcm. This library differs in the following design decisions:

  • Predictable execution time. Do not automatically retry request on failure. According to Google’s recommendations, each retry has to wait exponential back-off delay. We use a job queue backend like celery, where the best way to retry after some delay will be scheduling the task with countdown=delay. Sleeping while in Celery worker hurts your concurrency.
  • Do not forget results if you need to retry. This sounds obvious, but python-fcm drops important results, such as canonical ID mapping if request needs to be (partially) retried.
  • Clean pythonic API. No need to borrow all Java like exceptions etc.
  • Do not hard-code validation, let FCM fail. This decision makes library a little bit more future proof.

Support

FCM client is maintained by John Loehrer, contact me if you find any bugs or need help. You can view outstanding issues on the FCM Github page.

Contents:

Indices and tables