当前位置: 首页>>代码示例>>Python>>正文


Python Channel.pushMessage方法代码示例

本文整理汇总了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
开发者ID:magiclake,项目名称:chaowei,代码行数:9,代码来源:sample.py

示例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
开发者ID:alexhucy,项目名称:SmartData,代码行数:10,代码来源:sample.py

示例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)
开发者ID:hejie,项目名称:tangmen,代码行数:10,代码来源:Final.py

示例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
开发者ID:magiclake,项目名称:chaowei,代码行数:11,代码来源:sample.py

示例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
开发者ID:seamancode,项目名称:pusher_python_sdk,代码行数:12,代码来源:sample.py

示例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
开发者ID:fuzhouch,项目名称:amberalertcn,代码行数:14,代码来源:Pusher.py

示例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
开发者ID:alexhucy,项目名称:SmartData,代码行数:17,代码来源:sample.py

示例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
开发者ID:bcc0421,项目名称:SmartData,代码行数:19,代码来源:sample.py

示例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
开发者ID:alexhucy,项目名称:SmartData,代码行数:8,代码来源:sample.py


注:本文中的Channel.pushMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。