Firebase Cloud Messaging module.
Exceptions
QuotaExceededErrorexception firebase_admin.messaging.QuotaExceededError(message, cause=None, http_response=None) |
---|
Bases: Sending limit exceeded for the message target. |
SenderIdMismatchErrorexception firebase_admin.messaging.SenderIdMismatchError(message, cause=None, http_response=None) |
---|
Bases: The authenticated sender ID is different from the sender ID for the registration token. |
ThirdPartyAuthErrorexception firebase_admin.messaging.ThirdPartyAuthError(message, cause=None, http_response=None) |
---|
Bases: APNs certificate or web push auth key was invalid or missing. |
UnregisteredErrorexception firebase_admin.messaging.UnregisteredError(message, cause=None, http_response=None) |
---|
Bases: App instance was unregistered from FCM. This usually means that the token used is no longer valid and a new one must be used. |
Classes
APNSConfigclass firebase_admin.messaging.APNSConfig(headers=None, payload=None, fcm_options=None) |
---|
Bases: APNS-specific options that can be included in a message. Refer to APNS Documentation for more information.
|
APNSFCMOptionsclass firebase_admin.messaging.APNSFCMOptions(analytics_label=None, image=None) |
---|
Bases: Options for features provided by the FCM SDK for iOS.
|
APNSPayloadclass firebase_admin.messaging.APNSPayload(aps, **kwargs) |
---|
Bases: Payload of an APNS message.
|
AndroidConfigclass firebase_admin.messaging.AndroidConfig(collapse_key=None, priority=None, ttl=None, restricted_package_name=None, data=None, notification=None, fcm_options=None, direct_boot_ok=None) |
---|
Bases: Android-specific options that can be included in a message.
|
AndroidFCMOptionsclass firebase_admin.messaging.AndroidFCMOptions(analytics_label=None) |
---|
Bases: Options for features provided by the FCM SDK for Android.
|
AndroidNotificationclass firebase_admin.messaging.AndroidNotification(title=None, body=None, icon=None, color=None, sound=None, tag=None, click_action=None, body_loc_key=None, body_loc_args=None, title_loc_key=None, title_loc_args=None, channel_id=None, image=None, ticker=None, sticky=None, event_timestamp=None, local_only=None, priority=None, vibrate_timings_millis=None, default_vibrate_timings=None, default_sound=None, light_settings=None, default_light_settings=None, visibility=None, notification_count=None) |
---|
Bases: Android-specific notification parameters.
|
Apsclass firebase_admin.messaging.Aps(alert=None, badge=None, sound=None, content_available=None, category=None, thread_id=None, mutable_content=None, custom_data=None) |
---|
Bases: Aps dictionary to be included in an APNS payload.
|
ApsAlertclass firebase_admin.messaging.ApsAlert(title=None, subtitle=None, body=None, loc_key=None, loc_args=None, title_loc_key=None, title_loc_args=None, action_loc_key=None, launch_image=None, custom_data=None) |
---|
Bases: An alert that can be included in
|
BatchResponseclass firebase_admin.messaging.BatchResponse(responses) | ||||||
---|---|---|---|---|---|---|
Bases: The response received from a batch request to the FCM API.
|
CriticalSoundclass firebase_admin.messaging.CriticalSound(name, critical=None, volume=None) |
---|
Bases: Critical alert sound configuration that can be included in
|
ErrorInfoclass firebase_admin.messaging.ErrorInfo(index, reason) | ||||
---|---|---|---|---|
Bases: An error encountered when performing a topic management operation.
|
FCMOptionsclass firebase_admin.messaging.FCMOptions(analytics_label=None) |
---|
Bases: Options for features provided by SDK.
|
LightSettingsclass firebase_admin.messaging.LightSettings(color, light_on_duration_millis, light_off_duration_millis) |
---|
Bases: Represents settings to control notification LED that can be included in a
|
Messageclass firebase_admin.messaging.Message(data=None, notification=None, android=None, webpush=None, apns=None, fcm_options=None, token=None, topic=None, condition=None) |
---|
Bases: A message that can be sent via Firebase Cloud Messaging. Contains payload information as well as recipient information. In particular, the message must contain exactly one of token, topic or condition fields.
|
MulticastMessageclass firebase_admin.messaging.MulticastMessage(tokens, data=None, notification=None, android=None, webpush=None, apns=None, fcm_options=None) |
---|
Bases: A message that can be sent to multiple tokens via Firebase Cloud Messaging.
|
Notificationclass firebase_admin.messaging.Notification(title=None, body=None, image=None) |
---|
Bases: A notification that can be included in a message.
|
SendResponseclass firebase_admin.messaging.SendResponse(resp, exception) | ||||||
---|---|---|---|---|---|---|
Bases: The response received from an individual batched request to the FCM API.
|
TopicManagementResponseclass firebase_admin.messaging.TopicManagementResponse(resp) | ||||||
---|---|---|---|---|---|---|
Bases: The response received from a topic management operation.
|
WebpushConfigclass firebase_admin.messaging.WebpushConfig(headers=None, data=None, notification=None, fcm_options=None) |
---|
Bases: Webpush-specific options that can be included in a message.
|
WebpushFCMOptionsclass firebase_admin.messaging.WebpushFCMOptions(link=None) |
---|
Bases: Options for features provided by the FCM SDK for Web.
|
WebpushNotificationclass firebase_admin.messaging.WebpushNotification(title=None, body=None, icon=None, actions=None, badge=None, data=None, direction=None, image=None, language=None, renotify=None, require_interaction=None, silent=None, tag=None, timestamp_millis=None, vibrate=None, custom_data=None) |
---|
Bases: Webpush-specific notification parameters. Refer to the Notification Reference for more information.
|
WebpushNotificationActionclass firebase_admin.messaging.WebpushNotificationAction(action, title, icon=None) |
---|
Bases: An action available to the users when the notification is presented.
|
Functions
sendfirebase_admin.messaging.send(message, dry_run=False, app=None) |
---|
Sends the given message via Firebase Cloud Messaging (FCM). If the
|
send_allfirebase_admin.messaging.send_all(messages, dry_run=False, app=None) |
---|
Sends the given list of messages via Firebase Cloud Messaging as a single batch. If the
send_all() is deprecated. Use send_each() instead. |
send_eachfirebase_admin.messaging.send_each(messages, dry_run=False, app=None) |
---|
Sends each message in the given list via Firebase Cloud Messaging. If the
|
send_each_for_multicastfirebase_admin.messaging.send_each_for_multicast(multicast_message, dry_run=False, app=None) |
---|
Sends the given mutlicast message to each token via Firebase Cloud Messaging (FCM). If the
|
send_multicastfirebase_admin.messaging.send_multicast(multicast_message, dry_run=False, app=None) |
---|
Sends the given mutlicast message to all tokens via Firebase Cloud Messaging (FCM). If the
send_multicast() is deprecated. Use send_each_for_multicast() instead. |
subscribe_to_topicfirebase_admin.messaging.subscribe_to_topic(tokens, topic, app=None) |
---|
Subscribes a list of registration tokens to an FCM topic.
|
unsubscribe_from_topicfirebase_admin.messaging.unsubscribe_from_topic(tokens, topic, app=None) |
---|
Unsubscribes a list of registration tokens from an FCM topic.
|