Skip to content

Different messages be specified for each user #634

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions push_notifications/apns.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,23 @@ def _apns_prepare(
token, alert, application_id=None, badge=None, sound=None, category=None,
content_available=False, action_loc_key=None, loc_key=None, loc_args=[],
extra={}, mutable_content=False, thread_id=None, url_args=None):
if action_loc_key or loc_key or loc_args:
apns2_alert = apns2_payload.PayloadAlert(
body=alert if alert else {}, body_localized_key=loc_key,
body_localized_args=loc_args, action_localized_key=action_loc_key)
else:
apns2_alert = alert

if callable(badge):
badge = badge(token)

return apns2_payload.Payload(
alert=apns2_alert, badge=badge, sound=sound, category=category,
url_args=url_args, custom=extra, thread_id=thread_id,
content_available=content_available, mutable_content=mutable_content)
if callable(alert):
alert = alert(token)

if action_loc_key or loc_key or loc_args:
apns2_alert = apns2_payload.PayloadAlert(
body=alert if alert else {}, body_localized_key=loc_key,
body_localized_args=loc_args, action_localized_key=action_loc_key)
else:
apns2_alert = alert

if callable(badge):
badge = badge(token)

return apns2_payload.Payload(
alert=apns2_alert, badge=badge, sound=sound, category=category,
url_args=url_args, custom=extra, thread_id=thread_id,
content_available=content_available, mutable_content=mutable_content)


def _apns_send(
Expand Down