本文整理汇总了Python中Channel.pushMessage方法的典型用法代码示例。如果您正苦于以下问题:Python Channel.pushMessage方法的具体用法?Python Channel.pushMessage怎么用?Python Channel.pushMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Channel
的用法示例。
在下文中一共展示了Channel.pushMessage方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_pushMessage_to_all
# 需要导入模块: import Channel [as 别名]
# 或者: from Channel import pushMessage [as 别名]
def test_pushMessage_to_all(message):
c = Channel(apiKey, secretKey)
push_type = 3
optional = dict()
optional[Channel.MESSAGE_TYPE] = 1
ret = c.pushMessage(push_type, message, message_key, optional)
print ret
示例2: test_pushMessage_to_tag
# 需要导入模块: import Channel [as 别名]
# 或者: from Channel import pushMessage [as 别名]
def test_pushMessage_to_tag():
c = Channel(apiKey, secretKey)
push_type = 2
tag_name = 'push'
optional = dict()
optional[Channel.TAG_NAME] = tag_name
ret = c.pushMessage(push_type, message, message_key, optional)
print ret
示例3: test_pushMessage_to_tag
# 需要导入模块: import Channel [as 别名]
# 或者: from Channel import pushMessage [as 别名]
def test_pushMessage_to_tag():
c = Channel(apiKey, secretKey)
push_type = 2
optional = dict()
optional[Channel.TAG_NAME] = tagname
optional[Channel.MESSAGE_TYPE] = 1
# print 'hi:::::', push_type, message, message_key, optional
ret = c.pushMessage(push_type, message, message_key, optional)
示例4: test_pushMessage_to_user
# 需要导入模块: import Channel [as 别名]
# 或者: from Channel import pushMessage [as 别名]
def test_pushMessage_to_user(user_id,channel_id,phone_system,secretKey,message):
c = Channel(apiKey, secretKey)
push_type = 1
optional = dict()
optional[Channel.USER_ID] = user_id
optional[Channel.CHANNEL_ID] = channel_id
optional[Channel.MESSAGE_TYPE] = 1
ret = c.pushMessage(push_type, message, message_key, optional)
print ret
示例5: test_pushMessage_to_user
# 需要导入模块: import Channel [as 别名]
# 或者: from Channel import pushMessage [as 别名]
def test_pushMessage_to_user():
c = Channel(apiKey, secretKey)
push_type = 1
optional = dict()
optional[Channel.USER_ID] = user_id
optional[Channel.CHANNEL_ID] = channel_id
# 推送通知类型
optional[Channel.MESSAGE_TYPE] = 0
ret = c.pushMessage(push_type, message, message_key, optional)
print ret
示例6: push_to_user
# 需要导入模块: import Channel [as 别名]
# 或者: from Channel import pushMessage [as 别名]
def push_to_user(self, user, message):
channel = Channel(self.__secret.apiKey, self.__secret.secretKey)
push_type = 1
optional = dict()
optional[Channel.USER_ID] = user[0]
optional[Channel.CHANNEL_ID] = user[1]
optional[Channel.MESSAGE_TYPE] = 0
alertMessage = "{'title':'%s', 'description':'%s', 'custom_content': { 'amber_alert_id':'%s', 'from_user_id':'%s' }}" % (message[0], message[1], message[2], message[3])
#jsonMessage = json.dumps(updateMessage)
ret = channel.pushMessage(push_type, alertMessage, message_key, optional)
print (ret)
return ret
示例7: test_pushMessage_to_user
# 需要导入模块: import Channel [as 别名]
# 或者: from Channel import pushMessage [as 别名]
def test_pushMessage_to_user():
c = Channel(apiKey, secretKey)
c.DEFAULT_HOST=dev_host
push_type = 1
optional = dict()
optional[Channel.USER_ID] = 815730795201756090
#optional[Channel.USER_ID] = 665778416804465913
#optional[Channel.CHANNEL_ID] = 4617656892525519033
optional[Channel.CHANNEL_ID] = 4320553738754859600
#推送通知类型
optional[Channel.DEVICE_TYPE] = 4
optional[Channel.MESSAGE_TYPE] = 1
optional['phone_type'] = 'io'
ret = c.pushMessage(push_type, message, hashlib.md5(str(datetime.datetime.now())).hexdigest(), optional)
print ret
示例8: test_pushMessage_to_user
# 需要导入模块: import Channel [as 别名]
# 或者: from Channel import pushMessage [as 别名]
def test_pushMessage_to_user():
c = Channel(apiKey, secretKey)
c.DEFAULT_HOST=dev_host
push_type = 1
optional = dict()
#optional[Channel.USER_ID] = 900581881515728799
optional[Channel.USER_ID] = 654406316281477917
#optional[Channel.USER_ID] = 665778416804465913
#optional[Channel.CHANNEL_ID] = 4617656892525519033
optional[Channel.CHANNEL_ID] = 3800664848253686124
#optional[Channel.CHANNEL_ID] = 3800664848253686124
#推送通知类型
optional[Channel.DEVICE_TYPE] = 4
optional[Channel.MESSAGE_TYPE] = 1
optional['phone_type'] = 'ios'
ret = c.pushMessage(push_type, message, hashlib.md5(str(datetime.datetime.now())).hexdigest(), optional)
print ret
示例9: test_pushMessage_to_all
# 需要导入模块: import Channel [as 别名]
# 或者: from Channel import pushMessage [as 别名]
def test_pushMessage_to_all():
c = Channel(apiKey, secretKey)
push_type = 3
optional = dict()
ret = c.pushMessage(push_type, message, message_key, optional)
print ret