Skip to content

Commit

Permalink
made the body argument of PayloadAlert optional
Browse files Browse the repository at this point in the history
  • Loading branch information
adamrimon committed Sep 26, 2012
1 parent f549525 commit bc90e05
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apns.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def write(self, string):


class PayloadAlert(object):
def __init__(self, body, action_loc_key=None, loc_key=None,
def __init__(self, body=None, action_loc_key=None, loc_key=None,
loc_args=None, launch_image=None):
super(PayloadAlert, self).__init__()
self.body = body
Expand All @@ -154,7 +154,9 @@ def __init__(self, body, action_loc_key=None, loc_key=None,
self.launch_image = launch_image

def dict(self):
d = { 'body': self.body }
d = {}
if self.body:
d['body'] = self.body
if self.action_loc_key:
d['action-loc-key'] = self.action_loc_key
if self.loc_key:
Expand Down

0 comments on commit bc90e05

Please sign in to comment.