有谁知道实力极光推送错误码万能7码?

实力推送任8万能的9码是真的吗?_百度知道
实力推送任8万能的9码是真的吗?
实力推送任8万能的9码是真的吗?白了自己的位置,有的是一些企业的高管,有的是一个平凡的工人,他们只有写下了包袱,走出了自己的世
我有更好的答案
每当我想起我之前的事情,我都后怕因为那是不堪回首的记忆,在我还没遇见我的老师的时候,我输的几乎是倾家荡产,就是我快要输干净的时候,我遇见了我的老师概率王,是他让我重新振作起来,是他给我了我现在的生活,那种感激只能放在心里,有跟我一样经历的朋友,我把我老师的联系方式告诉你们 帮助那些还是回本路上迷茫的人,联系方式?(微;ƍ‘’‘)前三位876后四位4848希望能帮到你;-感到思想还
采纳率:100%
为您推荐:
其他类似问题
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。十一选 五3注万能7码有办法根据具体情况调整吗?_百度知道
十一选 五3注万能7码有办法根据具体情况调整吗?
我和老公相识5年。去年8月领的证,在领证过后,我们发生了三件事,都没有得到很好的解决。一是发现他和他的高中同学还在联系(在5年里,他们一直在联系着,说是普通朋友,可是常常隔三差五的联系,领证之前他答应我不在联系了)。我们因为这个事情大吵了一架,...
我有更好的答案
利用一些方法我们要舍弃最冷与最热的组合,选定一个突破口,定会中奖。除了方法之外,我们还可以利用走势图上的间隔发来判断出一些号码的基本走势我的朋友知道的更多,可以交流一下企鹅帐号【5722131】-----------------------------------------------------------------当岩体强度高时,有可能在相当大的拉底范围内形成稳定的拱,继续加大拉底面积,则矿石以很大的块度崩落,给出矿造成困难。岩石强度大不利于崩落,通常认为应用自然崩落法的岩石强度中等以下较为理想。岩体结构面的特征是直接影响崩落性的主要因素。节理间距,节理组数,节理的持续性,节理的方位、倾角,节理面的状态及充填物的性质等,都是影响崩落的直接因素。通常认为具有三组节理以上,有一组水平节理为好,节理间距越小越好,节理面平滑,充填物为软矿物且不宜胶结,这些条件是崩落的有利条件。
1条折叠回答
为您推荐:
其他类似问题
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。请选择产品
开发者中心
消息推送方式
消息推送方式
本章介绍了Python API的推送方式实例,推送模板结合推送方式即可完成整套推送方案。
1. 对单个用户推送消息
1.1 接口说明
接口名称
支持推送类型
说明
pushMessageToSingle
透传(payload)、点击通知启动应用、点击通知打开网页等
对单个用户(clientid)推送
接口名称正常推送不需要传requestId,如果发生异常重试时将requestId传入,具体用法详见示例代码。
def pushMessageToSingle(self, message, target, requestId=None)
1.2 pushMessageToSingle代码实例
# -*- coding: utf-8 -*-
__author__ = &wei&
from igt_push import *
from igetui.template import *
from igetui.template.igt_base_template import *
from igetui.template.igt_transmission_template import *
from igetui.template.igt_link_template import *
from igetui.template.igt_notification_template import *
from igetui.template.igt_notypopload_template import *
from igetui.igt_message import *
from igetui.igt_target import *
from igetui.template import *
#采用&Python SDK 快速入门&, &第二步 获取访问凭证 &中获得的应用配置
APPKEY = &Mjv706pTKt5cTcjtqaToz8&
APPID = &JroCkPGgpF6LzFQqqoWlhA&
MASTERSECRET = &uIBtmad7RK706cy5MKdfp3&
CID = &e560b884d8d9bf5bc5a0f9da545a11f3&
#别名推送方式
#ALIAS = &&;
HOST = &http://sdk.open.api.igexin.com/apiex.htm&
def pushMessageToSingle():
push = IGeTui(HOST, APPKEY, MASTERSECRET)
#push = IGeTui(&&,APPKEY,MASTERSECRET)#此方式可通过获取服务端地址列表判断最快域名后进行消息推送,每10分钟检查一次最快域名
#消息模版:
#TransmissionTemplate:透传功能模板,定义透传内容,应用启动形式
template = TransmissionTemplateDemo()
# 定义&SingleMessage&消息体,设置是否离线,离线有效时间,模板设置
message = IGtSingleMessage()
message.isOffline = True
message.offlineExpireTime = 1000 * 3600 * 12
message.data = template
message.pushNetWorkType = 1#设置是否根据WIFI推送消息,2为4G/3G/2G,1为wifi推送,0为不限制推送
target = Target()
target.appId = APPID
target.clientId = CID
#target.alias = ALIAS
ret = push.pushMessageToSingle(message, target)
except RequestException, e:
# 发生异常重新发送
requstId = e.getRequestId()
ret = push.pushMessageToSingle(message, target, requstId)
#透传模板动作内容
def TransmissionTemplateDemo():
template = TransmissionTemplate()
template.transmissionType = 1
template.appId = APPID
template.appKey = APPKEY
template.transmissionContent = &请输入您要透传内容&
iOS setAPNInfo
apnpayload = APNPayload()
apnpayload.badge = 4
apnpayload.sound = &sound&
apnpayload.addCustomMsg(&payload&, &payload&)
apnpayload.contentAvailable = 1
apnpayload.category = &ACTIONABLE&
alertMsg = DictionaryAlertMsg()
alertMsg.body = &body&
alertMsg.actionLocKey = &actionLockey&
alertMsg.locKey = &lockey&
alertMsg.locArgs=[&locArgs&]
alertMsg.launchImage = &launchImage&
# iOS8.2以上版本支持
alertMsg.title = &Title&
alertMsg.titleLocArgs = [&TitleLocArg&]
alertMsg.titleLocKey = &TitleLocKey&
apnpayload.alertMsg=alertMsg
template.setApnInfo(apnpayload)
#设置通知定时展示时间,结束时间与开始时间相差需大于6分钟(误差6分钟),消息推送后,客户端将在指定时间差内展示消息
#begin = & 17:40:22&;
#end = & 17:47:24&;
#template.setDuration(begin, end)
return template
pushMessageToSingle()
1.3 返回值
字段
返回码
客户端展示
2. 对指定用户列表推送消息
2.1 接口说明
如果仅对单个用户推送务必使用单推接口,否则会严重影响推送性能,如果对少量甚至几个用户推送同样的消息,建议使用单推实现,性能会更高
接口名称
支持推送类型
说明
pushMessageToList
透传(payload)、点击通知启动应用、点击通知打开网页等
(通过clientid列表)群推,可查看clientid列表中每个用户的在线状态
2.2 pushMessageToList代码实例
# -*- coding: utf-8 -*-
from igt_push import *
from igetui.template import *
from igetui.template.igt_base_template import *
from igetui.template.igt_transmission_template import *
from igetui.template.igt_link_template import *
from igetui.template.igt_notification_template import *
from igetui.template.igt_notypopload_template import *
from igetui.igt_message import *
from igetui.igt_target import *
from igetui.template import *
#toList接口每个用户返回用户状态开关,true:打开 false:关闭
os.environ[&gexin_pushList_needDetails&] = &false&
#采用&Python SDK 快速入门&, &第二步 获取访问凭证 &中获得的应用配置
APPKEY = &Mjv706pTKt5cTcjtqaToz8&
APPID = &JroCkPGgpF6LzFQqqoWlhA&
MASTERSECRET = &uIBtmad7RK706cy5MKdfp3&
CID1 = &e560b884d8d9bf5bc5a0f9da545a11f3&
CID2 = &e560b884d8d9bf5bc5a0f9da545a11f4&
#ALIAS1= &&
#ALIAS2= &&
HOST = &http://sdk.open.api.igexin.com/apiex.htm&
def pushMessageToList():
push = IGeTui(HOST, APPKEY, MASTERSECRET)
# 消息模版:
# NotificationTemplate:通知透传功能模板
template = TransmissionTemplateDemo()
message = IGtListMessage()
message.data = template
message.isOffline = True
message.offlineExpireTime = 1000 * 3600 * 12
message.pushNetWorkType = 0
target1 = Target()
target1.appId = APPID
target1.clientId = CID1
target1.alias = Alias1
target2 = Target()
target2.appId = APPID
target2.clientId = CID2
target2.alias = Alias2
arr.append(target1)
arr.append(target2)
contentId = push.getContentId(message, &ToList_任务别名_可为空&)
ret = push.pushMessageToList(contentId, arr)
# 通知透传模板动作内容
def TransmissionTemplateDemo():
template = TransmissionTemplate()
template.transmissionType = 1
template.appId = APPID
template.appKey = APPKEY
template.transmissionContent = &请输入您要透传内容&
iOS setAPNInfo
apnpayload = APNPayload()
apnpayload.badge = 4
apnpayload.sound = &sound&
apnpayload.addCustomMsg(&payload&, &payload&)
apnpayload.contentAvailable = 1
apnpayload.category = &ACTIONABLE&
alertMsg = DictionaryAlertMsg()
alertMsg.body = &body&
alertMsg.actionLocKey = &actionLockey&
alertMsg.locKey = &lockey&
alertMsg.locArgs=[&locArgs&]
alertMsg.launchImage = &launchImage&
iOS8.2以上版本支持
alertMsg.title = &Title&
alertMsg.titleLocArgs = [&TitleLocArg&]
alertMsg.titleLocKey = &TitleLocKey&
apnpayload.alertMsg=alertMsg
template.setApnInfo(apnpayload)
# 设置通知定时展示时间,结束时间与开始时间相差需大于6分钟,消息推送后,客户端将在指定时间差内展示消息(误差6分钟)
#begin = & 17:40:22&;
#end = & 17:47:24&;
#template.setDuration(begin, end)
return template
pushMessageToList()
2.3 返回值
字段
返回码
客户端展示
注:此接口有频次控制,申请修改请联系邮箱: 。
3. 对指定应用群推消息
3.1 接口说明
接口名称
支持推送类型
说明
pushMessageToApp
透传(payload)、点击通知启动应用、点击通知打开网页等
(通过应用AppID)群推,给所有符合条件的客户端用户推送
3.2 pushMessageToApp代码实例
# -*- coding: utf-8 -*-
from igt_push import *
from igetui.template import *
from igetui.template.igt_base_template import *
from igetui.template.igt_transmission_template import *
from igetui.template.igt_link_template import *
from igetui.template.igt_notification_template import *
from igetui.template.igt_notypopload_template import *
from igetui.igt_message import *
from igetui.igt_target import *
from igetui.template import *
#采用&Python SDK 快速入门&, &第二步 获取访问凭证 &中获得的应用配置
APPKEY = &Mjv706pTKt5cTcjtqaToz8&
APPID = &JroCkPGgpF6LzFQqqoWlhA&
MASTERSECRET = &uIBtmad7RK706cy5MKdfp3&
CID = &e560b884d8d9bf5bc5a0f9da545a11f3&
HOST = &http://sdk.open.api.igexin.com/apiex.htm&
def pushMessageToApp():
push = IGeTui(HOST, APPKEY, MASTERSECRET)
#push = IGeTui(&&,APPKEY,MASTERSECRET)#此方式可通过获取服务端地址列表判断最快域名后进行消息推送,每10分钟检查一次最快域名
#消息模版:
#NotificationTemplate:通知透传功能模板
template = TransmissionTemplateDemo()
#定义&AppMessage&,设置是否离线,离线有效时间,推送模板,推送速度等
message = IGtAppMessage()
message .setSpeed(100)#设置消息推送速度,单位为条/秒,例如填写100,则为100条/秒。仅支持对指定应用群推接口。
message.data = template
message.pushNetWorkType = 1#设置是否根据WIFI推送消息,1为wifi推送,0为不限制推送
message.isOffline = True
message.offlineExpireTime = 1000 * 3600 * 12
message.appIdList.extend([APPID])
message.phoneTypeList.extend([&ANDROID&, &IOS&])
message.provinceList.extend([&浙江&, &上海&,&北京&])
message.tagList.extend([&开心&])
ret = push.pushMessageToApp(message)
#通知透传模板动作内容
def TransmissionTemplateDemo():
template = TransmissionTemplate()
template.transmissionType = 1
template.appId = APPID
template.appKey = APPKEY
template.transmissionContent = &请输入您要透传内容&
iOS setAPNInfo
apnpayload = APNPayload()
apnpayload.badge = 4
apnpayload.sound = &sound&
apnpayload.addCustomMsg(&payload&, &payload&)
apnpayload.contentAvailable = 1
apnpayload.category = &ACTIONABLE&
alertMsg = DictionaryAlertMsg()
alertMsg.body = &body&
alertMsg.actionLocKey = &actionLockey&
alertMsg.locKey = &lockey&
alertMsg.locArgs=[&locArgs&]
alertMsg.launchImage = &launchImage&
# iOS8.2以上版本支持
alertMsg.title = &Title&
alertMsg.titleLocArgs = [&TitleLocArg&]
alertMsg.titleLocKey = &TitleLocKey&
apnpayload.alertMsg=alertMsg
template.setApnInfo(apnpayload)
# 设置通知定时展示时间,结束时间与开始时间相差需大于6分钟,消息推送后,客户端将在指定时间差内展示消息(误差6分钟)
#begin = & 17:40:22&;
#end = & 17:47:24&;
#template.setDuration(begin, end)
return template
pushMessageToApp()
3.3 返回值
字段
返回码
客户端展示
4. 推送结果返回值
正确返回
返回码
结果说明
successed_online
用户在线,消息在线下发
successed_offline
用户离线,消息存入离线系统
发送成功
返回用户状态的详细信息
任务ID(当result值为ok时,有此字段)
错误返回
返回码
结果说明
请求信息填写有误
action_error
未找到对应的action动作
appkey_error
Appkey填写错误
domain_error
填写的域名错误或者无法解析
sign_error
Appkey与ClientId不匹配,鉴权失败
AppidNoMatchAppKey
appid和鉴权的appkey不匹配
PushMsgToListOrAppTimesOverLimit
群推次数超过最大值
PushTotalNumOverLimit
推送个数总数超过最大值
AppIdNoUsers
该AppId下的用户总数为0
消息推送发送错误
SynSendError
报文发送错误
flow_exceeded
接口消息推送流量已超限
TargetListIsNullOrSizeIs0
推送target列表为空
PushTotalNumOverLimit
推送消息个数总数超限
TokenMD5NoUsers
target列表没有有效的clientID
NullMsgCommon
未找到contentId对应的任务
TaskIdHasBeanCanceled
任务已经被取消
AppidError
clientid绑定的appid与推送的appid不符
successed_ignore
无效用户,消息丢弃
TokenMD5Error
clientID填写有误
消息发送错误
AppidNoAppSecret
appid未找到对应的appSecret
OtherError
未知错误,无法判定错误类型
注:此接口有频次控制,申请修改请联系邮箱: 。
5. 任务组名推送
5.1 描述
一个应用同时下发了n个推送任务,为了更好地跟踪这n个任务的推送效果,可以把他们组成一个任务组,在查询数据时,只需要输入该任务组名即可同时查到n个任务的数据结果。
5.2 应用场景
场景:做AB test,分别下发A组、B组推送任务,将A、B任务建成“任务组1”,查数据时,仅需要查找任务组1,即可以一起看到A、B两组测试的结果,可以更直观地对比数据。
5.3 对应接口
命名同一个应用的不同taskid为同一个任务组名,任务组名由第三方填写。tolist(对指定用户列表推送消息)、toapp(对指定应用群推消息)接口支持该功能。
5.3.1 Tolist接口代码实例
def toListOfGroupName(host, appkey, mastersecret, message, taskGroupName):
push = IGeTui(host, appkey, mastersecret)
push.getContentId(message, taskGroupName)
具体推送代码详见
5.3.2 Toapp接口代码实例
def toListOfGroupName(host, appkey, mastersecret, message, taskGroupName):
push = IGeTui(host, appkey, mastersecret)
push.pushMessageToApp(message, taskGroupName)
6. 应用群推条件交并补功能
6.1 描述
应用群推对于复杂的查询条件新增加的交并补功能,以对应查询语义中的与或非的关系
6.2 应用场景
场景:需要发送给城市在A,B,C里面,没有设置tagtest标签,手机型号为android的用户,用条件交并补功能可以实现,city(A|B|C) && !tag(tagtest) && phonetype(andriod)
6.3 对应接口
AppConditions addCondition(self, key, values, optType = 0)
参数说明:
参数名
类型
必需
默认值
参数描述
查询条件键(phoneType 手机类型,region 省市,tag 用户标签)
查询条件值列表
条件类型(OptType.or 或, OptType.and 与, OptType.not 非)
6.4 代码实例
from array import array
from igt_push import *
from igetui.template import *
from igetui.template.igt_base_template import *
from igetui.template.igt_transmission_template import *
from igetui.template.igt_link_template import *
from igetui.template.igt_notification_template import *
from igetui.template.igt_notypopload_template import *
from igetui.igt_message import *
from igetui.template import *
from igetui.utils.AppConditions import *
APPKEY = &&
APPID = &&
MASTERSECRET = &&
HOST = &http://sdk.open.api.igexin.com/apiex.htm&
def pushMessageToApp():
push = IGeTui(HOST, APPKEY, MASTERSECRET)
template = NotificationTemplateDemo()
message = IGtAppMessage()
message.data = template
message.isOffline = True
message.offlineExpireTime = 1000 * 3600 * 12
message.appIdList.extend([APPID])
conditions = AppConditions();
phoneType = [&ANDROID&]
tags = [&dddd&, &ceshi2&]
conditions.addCondition(AppConditions.PHONE_TYPE, phoneType, OptType.OR)
conditions.addCondition(AppConditions.TAG, tags, OptType.AND)
message.setConditions(conditions)
ret = push.pushMessageToApp(message, &toApp_任务别名_可为空&)
def NotificationTemplateDemo():
template = NotificationTemplate()
template.appId = APPID
template.appKey = APPKEY
template.transmissionType = 1
template.transmissionContent = u&请填入透传内容&
template.title = u&请填入通知标题&
template.text = u&请填入通知内容&
template.logo = &icon.png&
template.logoURL = &&
template.isRing = True
template.isVibrate = True
template.isClearable = True
return template
7. 批量单推功能
7.1 描述
用于一次创建提交多个单推任务。
7.2应用场景
当单推任务较多时,推荐使用该接口,可以减少与服务端的交互次数。
7.3 对应接口
函数说明:
def add(self, message, target)
def submit(self)
def retry(self)
参数说明:
推送参数message和target与对单个用户推送消息使用的的参数相同
推送返回值:
批量单推每个单推消息的返回结果在submit返回值的info字段中,具体为加入时的序号和对应的返回结果。返回值详情请点击
7.4 代码实例
from BatchImpl import *
from igetui.igt_target import *
from igetui.template.igt_notification_template import *
from igt_push import *
APPKEY = &&
APPID = &&
MASTERSECRET = &&
HOST = &http://sdk.open.api.igexin.com/apiex.htm&
def pushMessageToSingleBatch():
push = IGeTui(HOST, APPKEY, MASTERSECRET)
batch = BatchImpl(APPKEY, push)
templateNoti = NotificationTemplateDemo()
templateLink = LinkTemplateDemo()
messageNoti = IGtSingleMessage()
messageNoti.isOffline = True
messageNoti.offlineExpireTime = 1000 * 3600 * 12
messageNoti.data = templateNoti
targetNoti = Target()
targetNoti.appId = APPID
targetNoti.clientId = CID1
batch.add(messageNoti, targetNoti)
messageLink = IGtSingleMessage()
messageLink.isOffline = True
messageLink.offlineExpireTime = 1000 * 3600 * 12
messageLink.data = templateLink
targetLink = Target()
targetLink.appId = APPID
targetLink.clientId = CID2
batch.add(messageLink, targetLink)
ret = batch.submit()
except Exception, e:
ret = batch.retry()
def NotificationTemplateDemo():
template = NotificationTemplate()
template.appId = APPID
template.appKey = APPKEY
template.transmissionType = 1
template.transmissionContent = u&请填入透传内容&
template.title = u&请填入通知标题&
template.text = u&请填入通知内容&
template.logo = &icon.png&
template.logoURL = &&
template.isRing = True
template.isVibrate = True
template.isClearable = True
return template
def LinkTemplateDemo():
template = LinkTemplate()
template.appId = APPID
template.appKey = APPKEY
template.title = u&请填入通知标题&
template.text = u&请填入通知内容&
template.logo = &&
template.url = &http://www.baidu.com&
template.transmissionType = 1
template.transmissionContent = &&
template.isRing = True
template.isVibrate = True
template.isClearable = True
return template
8. 短信补量推送接口
8.1 说明
针对推送,在消息有效时间内,对未收到推送消息的用户进行短信补发,既提升消息触达又节省成本
8.2 接入流程
8.2.1 获取应用参数
进入个推开发者中心后,个推消息推送模块,注册app,获取 appId、appKey 和 masterSecret 参数(妥善保管)。
8.2.2 模板报备
进行短信补量推送前,必须在个推申请开通短信补量并报备短信模板。短信模板审核通过后,才能进行短信补量推送。短信模板报备审核的日期为1-2个工作日。
8.2.3 模板示例
模板ID
模板内容
相关参数解释
示例【*】尊敬的${name},你的余额还剩${money}, 请尽快充值。
变量格式:${name},。
8.2.4 pn绑定
进行短信补量推送前,需要调用接口绑定cid与pn。推送时获取pn,进行消息下发。其中文档中所说的pn 都是指md5之后的手机号。
8.3 短信补量补发逻辑
个推推送消息下发时,对于在线用户,直接通过sdk通道下发,对于离线用户消息将存储在离线空间,等到用户设定的短信补发时间,将开始对已绑定pn的用户进行短信补发。 对于在补发前,经过个推通道成功下发消息的用户,将不再进行短信补发。
8.4 cid与pn绑定接口
8.4.1 接口描述
绑定cid和pn的关系,用户短信补量根据cid查询pn下发短信。
8.4.2 功能代码示例
static String appId = &xxxxxxx&;
static String appkey = &xxxxxxx&;
static String masterSecret = &xxxxxxx&;
static String cid = &xxxxxxx&;
static String pnmd5 = &xxxxxxx&;
static String host = &http://sdk.open.api.igexin.com/apiex.htm&;
public static void main(String[] args) {
private static void bindPn() {
IGtPush push = new IGtPush(host, appkey, masterSecret);
Map&String, String& cidAndPn = new HashMap&String, String&();
cidAndPn.put(cid, pnmd5);
IPushResult res = push.bindCidPn(appId, cidAndPn);
System.out.println(res.getResponse());
8.4.3 具体参数
参数
类型
是否必填
最大长度
描述
个推分配给开发者的ID
key是cid
value是pnmd5【32位小写】
8.4.4 返回值说明
参数
类型
是否必填
描述
示例值
其他
响应码
详细code码含义。参加文档最后【附录一】
返回每个cid的绑定结果
[{&code&:&0&,&cid&:&xxxx&}]
8.4.5 注意事项
1)目前接口最多支持一次绑定50个cid与pn的对应关系。绑定后会返回每个cid的绑定结果。
2)同个应用下pn和cid是一对一的关系,否则原关系会被替换
8.5 cid与pn解绑接口
8.5.1 接口描述
用户通过接口传递cid列表, 可以批量解绑与之相对应的pn的关系。
8.5.2 功能代码示例
static String appId = &xxxxxxx&;
static String appkey = &xxxxxxx&;
static String masterSecret = &xxxxxxx&;
static String cid = &xxxxxxx&;
static String pnmd5 = &xxxxxxx&;
static String host = &http://sdk.open.api.igexin.com/apiex.htm&;
public static void main(String[] args) {
unbindPn();
private static void unbindPn()
IGtPush push = new IGtPush(host, appkey, masterSecret);
List&String& cidList = new ArrayList&&();
cidList.add(cid);
IPushResult res = push.unbindCidPn(appId, cidList);
System.out.println(res.getResponse());
8.5.3 具体参数
参数
类型
是否必填
最大长度
描述
开发者ID
客户端身份ID列表
8.5.4 返回值说明
参数
类型
是否必填
描述
示例值
其他
响应码
详细code码含义。参加文档最后【附录一】
返回每个cid的绑定结果
[{&code&:&0&,&cid&:&xxxx&}]
8.5.5 注意事项
1)目前接口最多支持一次解绑50个cid
8.6 pn查询接口
8.6.1 接口描述
用户通过接口传递cid列表, 可以查询与之相对的pn,接口会批量返回绑定关系。
8.6.2 用法举例
static String appId = &xxxxxxx&;
static String appkey = &xxxxxxx&;
static String masterSecret = &xxxxxxx&;
static String cid = &xxxxxxx&;
static String pnmd5 = &xxxxxxx&;
static String host = &http://sdk.open.api.igexin.com/apiex.htm&;
public static void main(String[] args) {
queryPnByCid();
private static void queryPnByCid() {
IGtPush push = new IGtPush(host, appkey, masterSecret);
List&String& cidList = new ArrayList&&();
cidList.add(cid);
IPushResult res = push.queryCidPn(appId, cidList);
System.out.println(res.getResponse());
8.6.3 具体参数
参数
类型
是否必填
最大长度
描述
开发者ID
客户端身份ID列表
8.6.4 返回值说明
参数
类型
是否必填
描述
示例值
其他
响应码
详细code码含义。参加文档最后【附录一】
返回每个cid的绑定结果
[{&code&:&0&,&cid&:&xxxx&}]
8.6.5 注意事项
1)目前接口最多支持一次解绑50个cid
8.7 短信补量推送接口
8.7.1 接口列表
接口定义
说明
pushMessageToApp
对应用的所有用户群发推送消息
pushMessageToSingle
向单个clientid或别名用户推送消息
pushMessageToList
上传clientid或别名列表,对列表中所有clientid或别名用户进行消息推送
注:详细的推送逻辑参考个推官网。这里只是补充短信推送的逻辑
参考地址:http://docs.getui.com/getui/server/java/push/
8.7.2 支持短信模板的个推消息模板
消息模板
中文含义
是否支持短信模板
其他
Notification
通知模板
消息模板具体含义参考:http://docs.getui.com/getui/server/java/template/
LinkTemplate
网页模板
NotyPopLoadTemplate
下载模板
TransmissionTemplate
透传模板
8.7.3 短信推送模板参数
成员名或方法名
类型
是否必填
描述
示例值
其他
setSmsTemplateId()
推送的短信模板ID(短信模板说明)
smsinfo.setSmsTemplateId(&xxxx&);
具体使用,参考下面的代码中LinkTemplate中使用短信模板的示例。其他模板如此相同
setSmsContent()
推送的短信模板中占位符的内容。
Map smsContent = new HashMap&&();
smsContent.put(&name&, &张三&);
smsContent.put(&money&, &1234&);
smsinfo.setSmsContent(smsContent);
setOfflineSendtime()
推送后多久进行短信补发(单位:ms)
smsinfo.setOfflineSendtime(100000L);
pushMessageToApp 完整示例
public static LinkTemplate linkTemplateDemo() throws Exception {
LinkTemplate template = new LinkTemplate();
template.setAppId(appId);
template.setAppkey(appkey);
Style0 style = new Style0();
style.setTitle(&请输入通知栏标题&);
style.setText(&请输入通知栏内容&);
style.setLogo(&icon.png&);
style.setLogoUrl(&&);
style.setRing(true);
style.setVibrate(true);
style.setClearable(true);
template.setStyle(style);
template.setUrl(&http://www.getui.com&);
return template;
public static SmsInfo smsInfoDemo() throws Exception {
SmsInfo smsinfo = new SmsInfo();
smsinfo.setSmsTemplateId(&&);
Map&String, String& smsContent = new HashMap&&();
smsContent.put(&name&, &张三&);
smsContent.put(&money&, &1234&);
smsinfo.setSmsContent(smsContent);
smsinfo.setOfflineSendtime(100000L);
static String appId = &*****************&;
static String appkey = &*****************&;
static String masterSecret = &*****************&;
static String host = &*****************&;
public static void main(String[] args) throws Exception {
IGtPush push = new IGtPush(host, appkey, masterSecret);
LinkTemplate template = linkTemplateDemo();
template.setSmsInfo(smsInfoDemo());
AppMessage message = new AppMessage();
message.setData(template);
message.setOffline(true);
message.setOfflineExpireTime(24 * 1000 * 3600);
AppConditions cdt = new AppConditions();
List&String& appIdList = new ArrayList&String&();
appIdList.add(appId);
message.setAppIdList(appIdList);
List&String& phoneTypeList = new ArrayList&String&();
List&String& provinceList = new ArrayList&String&();
List&String& tagList = new ArrayList&String&();
cdt.addCondition(AppConditions.PHONE_TYPE, phoneTypeList);
cdt.addCondition(AppConditions.REGION, provinceList);
cdt.addCondition(AppConditions.TAG,tagList);
message.setConditions(cdt);
IPushResult ret = push.pushMessageToApp(message);
System.out.println(ret.getResponse().toString());
pushMessageToSingle 完整示例
private static String appId = &&;
private static String appKey = &&;
private static String masterSecret = &&;
static String cid = &&;
static String host = &http://sdk.open.api.igexin.com/apiex.htm&;
public static void main(String[] args) throws Exception {
IGtPush push = new IGtPush(host, appKey, masterSecret);
LinkTemplate template = linkTemplateDemo();
template.setSmsInfo(smsInfoDemo());
SingleMessage message = new SingleMessage();
message.setOffline(true);
message.setOfflineExpireTime(24 * 3600 * 1000);
message.setData(template);
message.setPushNetWorkType(0);
Target target = new Target();
target.setAppId(appId);
target.setClientId(cid);
IPushResult ret =
ret = push.pushMessageToSingle(message, target);
System.out.println(ret.getResponse().toString());
} catch (RequestException e) {
e.printStackTrace();}
public static LinkTemplate linkTemplateDemo() {
LinkTemplate template = new LinkTemplate();
template.setAppId(appId);
template.setAppkey(appKey);
Style0 style = new Style0();
style.setTitle(&请输入通知栏标题&);
style.setText(&请输入通知栏内容&);
style.setLogo(&icon.png&);
style.setLogoUrl(&&);
style.setRing(true);
style.setVibrate(true);
style.setClearable(true);
template.setStyle(style);
template.setUrl(&http://www.getui.com&);
return template;
public static SmsInfo smsInfoDemo() throws Exception {
SmsInfo smsinfo = new SmsInfo();
smsinfo.setSmsTemplateId(&2017011&);
Map&String, String& smsContent = new HashMap&&();
smsContent.put(&name&, &1234&);
smsContent.put(&money&, &1234&);
smsinfo.setSmsContent(smsContent);
smsinfo.setOfflineSendtime(100000L);
pushMessageToList 完整示例
private static String appId = &&;
private static String appKey = &&;
private static String masterSecret = &&;
static String cid1 = &&;
static String cid2 = &&;
static String host = &http://sdk.open.api.igexin.com/apiex.htm&;
public static void main(String[] args) throws Exception {
System.setProperty(&gexin_pushList_needDetails&, &true&);
IGtPush push = new IGtPush(host, appKey, masterSecret);
NotificationTemplate template = notificationTemplateDemo();
template.setSmsInfo(smsInfoDemo());
ListMessage message = new ListMessage();
message.setData(template);
message.setOffline(true);
message.setOfflineExpireTime(24 * 1000 * 3600);
List targets = new ArrayList();
Target target1 = new Target();
Target target2 = new Target();
target1.setAppId(appId);
target1.setClientId(cid1);
target2.setAppId(appId);
target2.setClientId(cid2);
targets.add(target1);
targets.add(target2);
String taskId = push.getContentId(message);
IPushResult ret = push.pushMessageToList(taskId, targets);
System.out.println(ret.getResponse().toString());
public static NotificationTemplate notificationTemplateDemo() {
NotificationTemplate template = new NotificationTemplate();
template.setAppId(appId);
template.setAppkey(appKey);
Style0 style = new Style0();
style.setTitle(&请输入通知栏标题&);
style.setText(&请输入通知栏内容&);
style.setLogo(&icon.png&);
style.setLogoUrl(&&);
style.setRing(true);
style.setVibrate(true);
style.setClearable(true);
template.setStyle(style);
template.setTransmissionType(2);
template.setTransmissionContent(&请输入您要透传的内容&);
return template;
public static SmsInfo smsInfoDemo() throws Exception {
SmsInfo smsinfo = new SmsInfo();
smsinfo.setSmsTemplateId(&2017011&);
Map&String, String& smsContent = new HashMap&&();
smsContent.put(&code&, &1234&);
smsContent.put(&time&, &1234&);
smsinfo.setSmsContent(smsContent);
smsinfo.setOfflineSendtime(100000L);
返回值说明
参数
类型
是否必填
描述
示例值
响应码
任务ID
contentId=xxxxxxx
短信提交结果
smsResult=accept
smsResultMsg
短信提交失败结果
smsResultMsg=模板不存在
推送返回的完整结果示例
结果
示例
说明
短信补量提交成功
{result=ok, contentId=xxxxx, smsResult=accept}
消息推送成功,短信提交成功。
短信补量提交失败
{result=ok, smsResultMsg=模板不存在, contentId=xxxxxxx, smsResult=error}
消息推送成功,短信提交失败。
注意事项
1)短信参数填错,将不会进行短信补量,但是通过个推的sdk推送的消息会正常下发
2)短信补量的开始时间必须在个推通道的离线时间内,且不大于服务端限制值(目前设置是3天)。
3)短信补发的整个内容的总长度不能超过70字。
8.8 pn与cid操作的相关状态码
状态码
含义
成功
cid不存在
cid与appid不匹配
不能覆写低级别的PN绑定
应用下该PN已经绑定更活跃的cid
cid为空
pn为空
该cid没有绑定PN值
其他原因导致的失败
在这篇文章中:
增加通知到达、点击回调
适配Android 8.0
修复若干其他bug
增加通知到达、点击回调
适配Android 8.0
修复若干其他bug
苹果消息推送添加语音功能(VOIP)
新增 VOIP 推送及统计支持。
优化 SDK 解决已知问题。
新增 SDK 离线状态返回。
优化 SDK 解决已知问题。}

我要回帖

更多关于 百度推送代码 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信