We currently have a solution to send the push notification from FCM to APNS and then to iOS. Due to the introduction of iOS13, the APNS now requires apns-push-type in any incoming payload that specifies whether it's an alert notification, background notification, or any other type. I am wondering how to add this information in the message sent to the FCM.
Currently we use pyFCM to send messages to FCM. And we follow this page as reference: https://firebase.google.com/docs/cloud-messaging/http-server-ref
from pyfcm import FCMNotification
push_service = FCMNotification(api_key="XXXX")
registration_id = '<Token>'
data_message = {
"Score": "3*1",
"DeviceId": "XXXXXX",
}
# Background notification
result = push_service.notify_single_device(registration_id=registration_id,
content_available=True,
data_message=data_message)
# Alert notification
result = push_service.notify_single_device(registration_id=registration_id,
message_title='Sample title',
message_body='Sample body',
data_message=data_message,
)
This works fine with existing iOS app. But for iOS 13, I cannot find any place to specify apns-push-type, or any equivalent field that FCM will translate to apns-push-type that would be sent to APNS.
I know iOS 13 is relatively new, so everyone is still working on adapting the existing solution to it. Hopefully someone can give me some insight how to put the apns-push-type into my existing solution. Thanks.