Skip to main content

Async Firebase Client - a Python asyncio client to interact with Firebase Cloud Messaging.

Project description

Async Firebase Cloud Messaging client

PyPI download total PyPI download month PyPI version fury.io PyPI license PyPI pyversions GitHub Workflow Status for CI Codacy coverage

Async Firebase - is a lightweight asynchronous client to interact with Firebase.

  • Free software: MIT license
  • Requires: Python 3.6+

Features

TBD...

Installation

$ pip install async-firebase

Getting started

To send push notification to either Android or iOS device:

import asyncio

from async_firebase import AsyncFirebaseClient


async def main():
    client = AsyncFirebaseClient()
    client.creds_from_service_account_file("secret-store/mobile-app-79225efac4bb.json")

    device_token = "..."

    response = await client.push(
        device_token=device_token,
        notification_title="Store Changes",
        notification_body="Recent store changes",
        notification_data={
            "discount": "15%",
            "key_1": "value_1"
        },
        priority="normal",
        apns_topic="store-updates",
        collapse_key="push",
        alert_text="test-alert",
        category="test-category",
        badge=1,
    )

    print(response)

if __name__ == "__main__":
    asyncio.run(main())

This prints:

{"name": "projects/mobile-app/messages/0:2367799010922733%7606eb557606ebff"}

License

async-firebase is offered under the MIT license.

Source code

The latest developer version is available in a GitHub repository: https://github.com/healthjoy/async-firebase

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

async-firebase-0.1.0.tar.gz (8.6 kB view hashes)

Uploaded Source

Built Distribution

async_firebase-0.1.0-py3-none-any.whl (8.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page