olucurious / PyFCM

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

Unable to add "subtitle" for an iOS push #276

Closed arthur-stpnv closed 3 years ago

arthur-stpnv commented 3 years ago

Hey, I wonder how to add "subtitle" value for iOS push notification, is it possible or not?

The final structure I'm trying to achieve:

{
  "aps": {
    "alert": {
      "title": "Some title",
      "subtitle": "Some subtitle",
      "body": "Some message"
    }
  }

Apple Documentation: https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CreatingtheNotificationPayload.html

arthur-stpnv commented 3 years ago

Found a solution:

subtitle = {'subtitle': "some subtitle"}
push_service.notify_single_device(registration_id=registration_id, message_title=title, message_body=body, extra_notification_kwargs = subtitle)