Skip to content
This repository has been archived by the owner on Feb 11, 2018. It is now read-only.

Commit

Permalink
Fixed a bug caused by dict.pop which makes title and message not
Browse files Browse the repository at this point in the history
available for notifications following the current one
  • Loading branch information
rakanalh committed Oct 4, 2017
1 parent ba896c5 commit 084194b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion pushy/dispatchers.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import copy
from django.conf import settings
from pushjack import (
APNSClient,
Expand Down Expand Up @@ -75,7 +76,12 @@ def establish_connection(self):
default_batch_size=100
)

def _send(self, token, payload):
def _send(self, token, notification_payload):
# pop causes a bug in altering the original payload
# which causes title and message to be empty
# for notifications following the currrent one.
payload = copy.deepcopy(notification_payload)

try:
response = self._client.send(
[token],
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='Django-Pushy',
version='1.0.0',
version='1.0.1',
author='Rakan Alhneiti',
author_email='[email protected]',

Expand Down

0 comments on commit 084194b

Please sign in to comment.