genesluder / python-apns

A library for interacting with APNs using HTTP/2 and token-based authentication.
MIT License
90 stars 50 forks source link

Notifications not being delivered due to url-args missing #35

Open DouglasLapsley opened 3 years ago

DouglasLapsley commented 3 years ago

Issue: APNS request sends and returns a 200 status, but fails to deliver because "url-args" not present in the json_data sent in the request.

Resolution: Enable kwargs url-args argument that injects into json_data before request is made. Example of working request structure:

{"aps": {"alert": {"title": "My Title", "body": "This is my body text"}, "url-args": ["a", "b", "c"]}}

This assumes that the Push Notifications package website.json file has a urlFormatString with three %@ swapouts corresponding to a, b and c.

If I've just missed this then my apologies, but I can't see support for these anywhere. It makes it fail quite silently, relying on the webServiceUrl error reporting to get the feedback about the missing url-args.

Thank you!