{"id":44959,"library":"firebase-messaging","title":"Firebase Messaging","description":"A Python client for Firebase Cloud Messaging (FCM) and Google Cloud Messaging (GCM) for sending push notifications. Current version 0.4.5 supports HTTP v1 API and legacy HTTP APIs. Actively maintained with weekly releases.","status":"active","version":"0.4.5","language":"python","source_language":"en","source_url":"https://github.com/sdb9696/firebase-messaging","tags":["fcm","push","firebase","notifications"],"install":[{"cmd":"pip install firebase-messaging","lang":"bash","label":"pip install"}],"dependencies":[{"reason":"HTTP client for API calls","package":"requests","optional":false},{"reason":"JWT token generation for OAuth2","package":"cryptography","optional":false}],"imports":[{"wrong":"from firebase_messaging import FirebaseMessaging","symbol":"FcmPushClient","correct":"from firebase_messaging import FcmPushClient"},{"symbol":"FcmPushClientConfig","correct":"from firebase_messaging import FcmPushClientConfig"},{"symbol":"FcmRegisterConfig","correct":"from firebase_messaging import FcmRegisterConfig"}],"quickstart":{"code":"from firebase_messaging import FirebaseMessaging\nimport os\n\n# Initialize with service account JSON file path\nfb = FirebaseMessaging(credentials_file=os.environ.get('FCM_CREDENTIALS', ''))\n\n# Send a simple notification\nresponse = fb.send_notification(\n    token='device_token',\n    title='Hello',\n    body='World'\n)\nprint(response)","lang":"python","description":"Sends a push notification to a single device token using Firebase Cloud Messaging HTTP v1 API."},"warnings":[{"fix":"Ensure you pass a file path string, e.g., `.json` file from Firebase Console.","message":"The `credentials_file` parameter expects the path to a JSON service account key file, not the raw JSON string. Passing a string that is not a valid file path raises a `FileNotFoundError`.","severity":"gotcha","affected_versions":">=0.4.0"},{"fix":"Instantiate `FirebaseMessaging` with `use_legacy=False` (default) and use OAuth2 authentication.","message":"Legacy FCM API (HTTP XMPP) support is deprecated in v0.4.5 and will be removed in v0.5. Use the HTTP v1 API instead.","severity":"deprecated","affected_versions":">=0.4.5"},{"fix":"Update imports: `from firebase_messaging import FirebaseMessaging`","message":"In v0.4.0, the import paths changed. `FirebaseMessaging` was moved from `firebase_messaging.client` to `firebase_messaging`. Old imports will raise `ImportError`.","severity":"breaking","affected_versions":"0.3.x -> 0.4.0"}],"env_vars":null,"search_vec":"'0.4.5':22 'activ':31 'api':26,30 'client':5 'cloud':8,13 'current':20 'fcm':10,36 'firebas':1,7,38 'gcm':15 'googl':12 'http':24,29 'legaci':28 'maintain':32 'messag':2,9,14 'notif':19,39 'push':18,37 'python':4 'releas':35 'send':17 'support':23 'v1':25 'version':21 'week':34","created_at":"2026-06-07T12:52:41.403958+00:00","updated_at":"2026-06-07T12:52:41.403958+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/sdb9696/firebase-messaging","github":"https://github.com/sdb9696/firebase-messaging","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["messaging"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":null}}