Firebase API
Apps
Configuration of the Firebase API app
Firebase API Client
- class integreat_cms.firebase_api.firebase_api_client.FirebaseApiClient(push_notification: PushNotification)[source]
Bases:
object
Firebase Push Notifications / Firebase Cloud Messaging
Sends push notifications via FCM HTTP API. Definition: https://firebase.google.com/docs/cloud-messaging/http-server-ref#downstream-http-messages-json
Warning
We use legacy HTTP-API - Migration to HTTP v1-API will be necessary! https://firebase.google.com/docs/cloud-messaging/migrate-v1
- Parameters:
push_notification (PushNotification) –
- __init__(push_notification: PushNotification) None [source]
Load relevant push notification translations and prepare content for sending
- Parameters:
push_notification (PushNotification) – the push notification that should be sent
- Raises:
ImproperlyConfigured – If the auth key is missing or the system runs in debug mode but the test region does not exist.
- Return type:
None
- is_valid() bool [source]
Check if all data for sending push notifications is available
- Returns:
all prepared push notification translations are valid
- Return type:
- load_secondary_pnts() None [source]
Load push notification translations in other languages
- Return type:
None
- send_all() bool [source]
Send all prepared push notification translations
- Returns:
Success status
- Return type:
- send_pn(pnt: PushNotificationTranslation, region: Region) Response [source]
Send single push notification translation
- Parameters:
pnt (PushNotificationTranslation) – The prepared push notification translation to be sent
region (Region) – The region for which to send the prepared push notification translation
- Returns:
Response of the
requests
library- Return type:
Response