Commit b15642a2 authored by linbo's avatar linbo

Fix extra parameters issue

parent 0cc27c96
from .client import JPushClient from .client import JPushClient
__version__ = '0.1.1' __version__ = '0.1.2'
VERSION = tuple(map(int, __version__.split('.'))) VERSION = tuple(map(int, __version__.split('.')))
__all__ = ['JPushClient'] __all__ = ['JPushClient']
...@@ -37,13 +37,15 @@ class JPushClient: ...@@ -37,13 +37,15 @@ class JPushClient:
def _gen_content(self, msg_title, msg_content, msg_type, extras): def _gen_content(self, msg_title, msg_content, msg_type, extras):
"""Generate message content""" """Generate message content"""
content = {"extras": extras} content = {}
if msg_type == 1: # notification if msg_type == 1: # notification
content["n_title"] = msg_title content["n_title"] = msg_title
content["n_content"] = msg_content content["n_content"] = msg_content
content["n_extras"] = extras
else: # custom message else: # custom message
content["title"] = msg_title content["title"] = msg_title
content["message"] = msg_content content["message"] = msg_content
content["extras"] = extras
return json.dumps(content, separators=(',', ':')) return json.dumps(content, separators=(',', ':'))
def _gen_verification_code(self, sendno, receiver_type, receiver_value): def _gen_verification_code(self, sendno, receiver_type, receiver_value):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment