コード例 #1
0
ファイル: demo.py プロジェクト: shaobenbin/getui
def pushMessageToSingleBatch():
    push = IGeTui(HOST, APPKEY, MASTERSECRET)
    batch = BatchImpl(APPKEY, push)
    
    # 消息模版:
    # 1.TransmissionTemplate:透传功能模板
    # 2.LinkTemplate:通知打开链接功能模板
    # 3.NotificationTemplate:通知透传功能模板
    # 4.NotyPopLoadTemplate:通知弹框下载功能模板

    template = NotificationTemplateDemo()
    # template = LinkTemplateDemo()
    # template = TransmissionTemplateDemo()
    # template = NotyPopLoadTemplateDemo()
    
    message = IGtSingleMessage()
    message.isOffline = True
    message.offlineExpireTime = 1000 * 3600 * 12
    message.data = template
#     message.pushNetWorkType = 1

    target = Target()
    target.appId = APPID
    target.clientId = CID

    batch.add(message, target)
    try:
        ret = batch.submit()
        print ret
    except Exception, e:
        ret=batch.retry()
        print ret
コード例 #2
0
def pushMessageToSingleBatch():
    push = IGeTui(HOST, APPKEY, MASTERSECRET)
    batch = BatchImpl(APPKEY, push)
    
    # 消息模版:
    # 1.TransmissionTemplate:透传功能模板
    # 2.LinkTemplate:通知打开链接功能模板
    # 3.NotificationTemplate:通知透传功能模板
    # 4.NotyPopLoadTemplate:通知弹框下载功能模板

    templateNoti = NotificationTemplateDemo()
    templateLink = LinkTemplateDemo()
    # template = TransmissionTemplateDemo()
    # template = NotyPopLoadTemplateDemo()
    
    messageNoti = IGtSingleMessage()
    messageNoti.isOffline = True
    messageNoti.offlineExpireTime = 1000 * 3600 * 12
    messageNoti.data = templateNoti
#     message.pushNetWorkType = 1

    targetNoti = Target()
    targetNoti.appId = APPID
    targetNoti.clientId = CID1

    batch.add(messageNoti, targetNoti)
    
	messageLink = IGtSingleMessage()
コード例 #3
0
def pushMessageToSingleBatch():
    push = IGeTui(HOST, APPKEY, MASTERSECRET)
    batch = BatchImpl(APPKEY, push)

    # 消息模版:
    # 1.TransmissionTemplate:透传功能模板
    # 2.LinkTemplate:通知打开链接功能模板
    # 3.NotificationTemplate:通知透传功能模板
    # 4.NotyPopLoadTemplate:通知弹框下载功能模板

    # template = NotificationTemplateDemo()
    # template = LinkTemplateDemo()
    template = TransmissionTemplateDemo()
    # template = NotyPopLoadTemplateDemo()

    message = IGtSingleMessage()
    message.isOffline = True
    message.offlineExpireTime = 1000 * 3600 * 12
    message.data = template
    #     message.pushNetWorkType = 1

    target = Target()
    target.appId = APPID
    target.clientId = CID

    batch.add(message, target)
    try:
        ret = batch.submit()
        print ret
    except Exception, e:
        ret = batch.retry()
        print ret
コード例 #4
0
def pushMessageToSingleBatch():
    push = IGeTui(HOST, APPKEY, MASTERSECRET)
    batch = BatchImpl(APPKEY, push)

    # 消息模版:
    # 1.TransmissionTemplate:透传功能模板
    # 2.LinkTemplate:通知打开链接功能模板
    # 3.NotificationTemplate:通知透传功能模板
    # 4.NotyPopLoadTemplate:通知弹框下载功能模板

    templateNoti = NotificationTemplateDemo()
    templateLink = LinkTemplateDemo()
    # template = TransmissionTemplateDemo()

    messageNoti = IGtSingleMessage()
    messageNoti.isOffline = True
    messageNoti.offlineExpireTime = 1000 * 3600 * 12
    messageNoti.data = templateNoti
    #     message.pushNetWorkType = 1

    targetNoti = Target()
    targetNoti.appId = APPID
    targetNoti.clientId = CID
    batch.add(messageNoti, targetNoti)

    messageLink = IGtSingleMessage()
    messageLink.isOffline = True
    messageLink.offlineExpireTime = 1000 * 3600 * 12
    messageLink.data = templateLink
    #     message.pushNetWorkType = 1

    targetLink = Target()
    targetLink.appId = APPID
    targetLink.clientId = "532434e53324be9c2a68c4f5923f07a9"
    batch.add(messageLink, targetLink)
    try:
        ret = batch.submit()
        print(ret)
    except Exception as e:
        ret = batch.retry()
        print(ret)
コード例 #5
0
 def getBatch(self):
     return BatchImpl(self, self.appKey, self)