Commit b0b556dd authored by hupantingxue's avatar hupantingxue

Add registration id push api;

parent 07c0f3da
...@@ -34,3 +34,11 @@ jpush_client.send_notification_by_appkey(app_key, sendno, 'des', ...@@ -34,3 +34,11 @@ jpush_client.send_notification_by_appkey(app_key, sendno, 'des',
jpush_client.send_custom_msg_by_appkey(app_key, sendno, 'des', jpush_client.send_custom_msg_by_appkey(app_key, sendno, 'des',
'appkey msg title', 'appkey msg title',
'appkey msg content', 'android') 'appkey msg content', 'android')
# Send message by registration_id
jpush_client.send_notification_by_registrationid('regidapi', app_key, sendno, 'des',
'registration id notify title',
'registration id notify content', 'android')
jpush_client.send_custom_msg_by_registrationid('regidapi', app_key, sendno, 'des',
'registration_id msg title',
'registration_id msg content', 'android')
...@@ -160,3 +160,32 @@ class JPushClient: ...@@ -160,3 +160,32 @@ class JPushClient:
receiver_value) receiver_value)
params = self._gen_params(locals()) params = self._gen_params(locals())
self._send_msg(params) self._send_msg(params)
def send_notification_by_registrationid(self, registrationid, app_key, sendno, senddes, msgtitle,
msg_content, platform, extras={}):
'''Send notification by registraion id'''
receiver_type = 5
msg_type = 1
msg_content = self._gen_content(msgtitle, msg_content,
msg_type, extras)
receiver_value = tag
verification_code = self._gen_verification_code(sendno,
receiver_type,
receiver_value)
params = self._gen_params(locals())
self._send_msg(params)
def send_custom_msg_by_registrationid(self, registrationid, app_key, sendno, senddes,
msgtitle, msg_content,
platform, extras={}):
'''Send custom message by registration id'''
receiver_type = 5
msg_type = 2
msg_content = self._gen_content(msgtitle, msg_content,
msg_type, extras)
receiver_value = tag
verification_code = self._gen_verification_code(sendno,
receiver_type,
receiver_value)
params = self._gen_params(locals())
self._send_msg(params)
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