This code is working as expected, but all the notifications sent are set default expiry time (28 days).
from pyfcm import FCMNotification
push_service = FCMNotification(api_key="<api-key>")
data_message = {"foo":"bar"}
result = push_service.notify_single_device(registration_id=registration_id, data_message=data_message)
How can I set the expire time to less than default so very old notifications dont make their way to the users devices?
Taking a look at the PyFCM documentation on GitHub I could find the solution:
Example implementation to set notification to expire after 1 hour if not delivered: