Metadata-Version: 2.1
Name: async-firebase
Version: 0.3.0
Summary: Async Firebase Client - a Python asyncio client to interact with Firebase Cloud Messaging.
Home-page: https://github.com/healthjoy/async-firebase
License: MIT
Keywords: async,asyncio,firebase,fcm,python3
Author: Aleksandr Omyshev
Author-email: oomyshev@healthjoy.com
Maintainer: Healthjoy Developers
Maintainer-email: developers@healthjoy.com
Requires-Python: >=3.6.1,<3.10
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: google-auth (>=1.26,<1.27)
Requires-Dist: httpx (>=0.16,<0.17)
Requires-Dist: requests (>=2.25.1,<2.26.0)
Project-URL: Repository, https://github.com/healthjoy/async-firebase
Description-Content-Type: text/markdown

# async-firebase is a lightweight asynchronous client to interact with Firebase Cloud Messaging for sending push notification to Android and iOS devices

[![PyPI download total](https://img.shields.io/pypi/dt/async-firebase.svg)](https://pypi.python.org/pypi/async-firebase/)
[![PyPI download month](https://img.shields.io/pypi/dm/async-firebase.svg)](https://pypi.python.org/pypi/async-firebase/)
[![PyPI version fury.io](https://badge.fury.io/py/async-firebase.svg)](https://pypi.python.org/pypi/async-firebase/)
[![PyPI license](https://img.shields.io/pypi/l/async-firebase.svg)](https://pypi.python.org/pypi/async-firebase/)
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/async-firebase.svg)](https://pypi.python.org/pypi/async-firebase/)
[![GitHub Workflow Status for CI](https://img.shields.io/github/workflow/status/healthjoy/async-firebase/CI?label=CI&logo=github)](https://github.com/healthjoy/async-firebase/actions?query=workflow%3ACI)
[![Codacy coverage](https://img.shields.io/codacy/coverage/b6a59cdf5ca64eab9104928d4f9bbb97?logo=codacy)](https://app.codacy.com/gh/healthjoy/async-firebase/dashboard)


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

## Features

  * Extremely lightweight and does not rely on ``firebase-admin`` which is hefty
  * Send push notifications to Android and iOS devices
  * Set TTL (time to live) for notifications
  * Set priority for notifications
  * Set collapse-key for notifications
  * Dry-run mode for testing purpose

## Installation
```shell script
$ pip install async-firebase
```

## Getting started
To send push notification to either Android or iOS device:
```python3
import asyncio

from async_firebase import AsyncFirebaseClient


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

    # or using dictionary object
    # client.creds_from_service_account_info({...}})

    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:
```shell script
{"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

