站点工具

New release available: 2020-07-29 "Hogfather". upgrade now! [51.3] (what's this?)
New release candidate 3 available: 2020-06-09 "Hogfather". upgrade now! [51.2] (what's this?)
New release candidate 2 available: 2020-06-01 "Hogfather". upgrade now! [51.1] (what's this?)
New release candidate available: 2020-06-01 "Hogfather". upgrade now! [51] (what's this?)
Hotfix release available: 2018-04-22c "Greebo". upgrade now! [50.3] (what's this?)
Hotfix release available: 2018-04-22b "Greebo". upgrade now! [50.2] (what's this?)
Hotfix release available: 2018-04-22a "Greebo". upgrade now! [50.1] (what's this?)
New release available: 2018-04-22 "Greebo". upgrade now! [50] (what's this?)
Hotfix release available: 2017-02-19g "Frusterick Manners". upgrade now! [49.7] (what's this?)
Hotfix release available: 2017-02-19f "Frusterick Manners". upgrade now! [49.6] (what's this?)
Hotfix release available: 2017-02-19e "Frusterick Manners". upgrade now! [49.5] (what's this?)
Hotfix release available fixing CVE-2017-12979 and CVE-2017-12980: 2017-02-19d "Frusterick Manners". upgrade now! [49.4] (what's this?)
Hotfix release available fixing CVE-2017-12583: 2017-02-19c "Frusterick Manners". upgrade now! [49.3] (what's this?)
Hotfix release available fixing security token and media manager: 2017-02-19b "Frusterick Manners". upgrade now! [49.2] (what's this?)
Hotfix release available fixing install and media manager issues: 2017-02-19a "Frusterick Manners". upgrade now! [49.1] (what's this?)
New release available: 2017-02-19 "Frusterick Manners". upgrade now! [49] (what's this?)
Hotfix release available: 2016-06-26e "Elenor of Tsort". upgrade now! [48.5] (what's this?)
Hotfix release available fixing CVE-2017-12979 and CVE-2017-12980: 2016-06-26d "Elenor of Tsort". upgrade now! [48.4] (what's this?)
Hotfix release available fixing CVE-2017-12583: 2016-06-26c "Elenor of Tsort". upgrade now! [48.3] (what's this?)
Hotfix release available fixing security token: 2016-06-26b "Elenor of Tsort". upgrade now! [48.2] (what's this?)
Hotfix release available fixing authad issues: 2016-06-26a "Elenor of Tsort". upgrade now! [48.1] (what's this?)
New release available: 2016-06-26 "Elenor of Tsort". upgrade now! [48] (what's this?)
Hotfix release available: 2015-08-10a "Detritus". upgrade now! [47.1] (what's this?)
New release available: 2015-08-10 "Detritus". upgrade now! [47] (what's this?)
Hotfix release available: 2014-09-29d "Hrun". upgrade now! [46.4] (what's this?)
Hotfix release available: 2014-09-29c "Hrun". upgrade now! [46.3] (what's this?)
Hotfix release available to prevent XSS attack via SWF uploads: 2014-09-29b "Hrun". upgrade now! [46.2] (what's this?)
Hotfix release available: 2014-09-29a "Hrun". upgrade now! [46.1] (what's this?)
New release available: 2014-09-29 "Hrun". upgrade now! [46] (what's this?)
Hotfix release available: 2014-05-05e "Ponder Stibbons". upgrade now! [44.5] (what's this?)
Hotfix release available: 2014-05-05d "Ponder Stibbons". upgrade now! [44.4] (what's this?)
Hotfix release available to prevent XSS attack via SWF uploads: 2014-05-05c "Ponder Stibbons". upgrade now! [44.3] (what's this?)
Security Hotfix 2014-05-05b to prevent zero byte attacks on external auth systems is available. upgrade now! [44.2] (what's this?)
Security Hotfix 2014-05-05a for Issue 765 available. upgrade now! [44.1] (what's this?)

apush

Android消息推送接口

电商类的消息信息不存在非常强的实时性,为了避免驻留后台进程,被360手机卫士、腾讯手机管家等杀掉或在后台驻留排行榜中列出,不采取驻留后台进程维持长连接的方式,而是采用闹钟定时(间隔30分钟)唤醒后台进程,通过本接口获取属于该用户的推送信息,并显示在手机通知栏,之后自动关闭后台进程自身(不驻留后台)。

1、针对单个用户的消息推送写入接口(服务器端PHP引用方式调用的接口)

<?php
require_once("/Data/webapps/m.repai.com/m/phpapi.php"); //PHP引用方式,需要引用的框架入口文件
$parameters_array["appkey"] = "100005";
$parameters_array["appoid"] = "d19149dd97b17ce55e70abd2f9e64d3d"; //这里的appoid不是客户端提交的原始appoid,而是原始appoid md5后的值
$parameters_array["message"] = "这里是要推送的消息";
$parameters_array["opensound"] = "1"; //打开声音
$parameters_array["openmode"] = "push";
$parameters_array["openurl"] = "http://www.baidu.com/";
$result = phpapi_mvc("apush", "person_put_phpapi", $parameters_array);

if (empty($result["status"])) {
	var_dump($result); //打印出返回内容
} else {
	var_dump($result["error"]); //打印出错误内容
}
?>

输入参数说明:

  • appkey 【热拍卖家版Android客户端的appkey为100005,iOS为100004;买家版HTML5为100001,iOS为100002,Android为100003】
  • appoid 【设备的唯一ID的md5值,android手机取网卡mac地址的md5值作为唯一ID;iOS手机取OpenUDID的md5值作为唯一ID。】
  • message 【要推送的文本消息】
  • opensound 【是否打开消息提醒声音,字符串1为打开,0为关闭】
  • openmode 【点击推送消息打开指定网页的模式:non不开启,push以push模式打开,present以present模式打开,browser以外部浏览器打开】
  • openurl 【点击推送消息打开的指定网址】

输出参数说明:

  • 写入成功,返回布尔值 true
  • 写入失败,返回布尔值 false

2、针对目标群体用户的消息推送写入接口(服务器端PHP引用方式调用的接口)

<?php
require_once("/Data/webapps/m.repai.com/m/phpapi.php"); //PHP引用方式,需要引用的框架入口文件
$parameters_array["appkey"] = "100005";
$parameters_array["appoid"] = "d19149dd97b17ce55e70abd2f9e64d3d"; //这里的appoid不是客户端提交的原始appoid,而是原始appoid md5后的值
$parameters_array["message"] = "这里是要推送的消息";
$parameters_array["opensound"] = "1"; //打开声音
$parameters_array["openmode"] = "push";
$parameters_array["openurl"] = "http://www.baidu.com/";
$result = phpapi_mvc("apush", "club_put_phpapi", $parameters_array);

if (empty($result["status"])) {
	var_dump($result); //打印出返回内容
} else {
	var_dump($result["error"]); //打印出错误内容
}
?>

输入参数说明:

  • appkey 【热拍卖家版Android客户端的appkey为100005,iOS为100004;买家版HTML5为100001,iOS为100002,Android为100003】
  • rp_club_id 【俱乐部ID,根据用户喜好,会将每个用户添加到不同的俱乐部,推送给该俱乐部的消息,会同时推送给俱乐部拥有的用户】
  • message 【要推送的文本消息】
  • opensound 【是否打开消息提醒声音,字符串1为打开,0为关闭】
  • openmode 【点击推送消息打开指定网页的模式:non不开启,push以push模式打开,present以present模式打开,browser以外部浏览器打开】
  • openurl 【点击推送消息打开的指定网址】

输出参数说明:

  • 写入成功,返回布尔值 true
  • 写入失败,返回布尔值 false

3、Android 客户端定时请求获取消息列表的接口

http://m.repai.com/apush/get_api/appkey/密钥编号/appoid/手机设备唯一编号/timestamp/1402307990/token/73191b75734ea67df90cbb824ff67811

为了节省流量,此接口使用 HTTP 协议,而非 HTTPS 协议。

输入参数说明:

  • appkey 【热拍卖家版Android客户端的appkey为100005,iOS为100004;买家版HTML5为100001,iOS为100002,Android为100003】
  • appoid 【设备的唯一ID,android手机取网卡mac地址的md5值作为唯一ID;iOS手机取OpenUDID作为唯一ID】
  • timestamp 【当前的UNIX时间戳,时间戳有效期20分钟】
  • token 【防篡改验证串,token值的组成为,以PHP代码为例:md5(“RP”.$appkey.$appsecret.$appoid.$timestamp) 由客户端生成,其中 $appsecret为密钥,每个appkey对应的不同的密钥,密钥请询问张宴】

输出参数说明:

  • JSON格式输出,错误时,status值为false,reason值为错误原因文本信息,示例如下:
{
"reason": "TOKEN验证未通过,非法请求!",
"status": false
}
  • JSON格式输出,无推送消息时,status值也为false,示例如下:
{
"reason": "无消息列表。",
"status": false
}
  • JSON格式输出,有消息时,status值为true,示例如下:
{
"list": [
	{
		"message": "这里是要推送的消息1",
		"openmode": "push",
		"opensound": "1",
		"openurl": "http://www.baidu.com/"
	},
	{
		"message": "这里是要推送的消息2",
		"openmode": "present",
		"opensound": "1",
		"openurl": "http://www.baidu.com/"
	},
	{
		"message": "这里是要推送的消息3",
		"openmode": "non",
		"opensound": "1"
	}
],
"reason": "获取到消息列表。",
"status": true
}

备注:如果有多条消息(最多5条),客户端循环显示。


相关接口:根据用户rp_uid查询手机设备唯一编号appoid接口

返回首页

apush.txt · 最后更改: 2014/07/23 11:01 由 106.2.171.114