olucurious / PyFCM

Python client for FCM - Firebase Cloud Messaging (Android, iOS and Web)
http://olucurious.github.io/PyFCM/
MIT License
802 stars 204 forks source link

The options click_action and low_priority not available anymore. #341

Closed jarzac closed 2 months ago

jarzac commented 2 months ago

The following options when sending messages using push_service.notify are not available anymore.

Niccari commented 2 months ago

Starting with PyFCM v2, platform-specific parameters are specified in android_config and apns_config. Fields in Android are defined in the FCM HTTP v1 API AndroidConfigs.

Thus, click_action and low_priority can be specified as follows.

result = push_service.notify(
    topic_name="topic",
    notification_body=message,
    android_config={
        "priority": "normal",    # "high" for high priority
        "notification": {
            "click_action":"YOUR_ACTION"
        }
    }
)
olucurious commented 2 months ago

Check this section - https://github.com/olucurious/PyFCM?tab=readme-ov-file#extra-argument-options