目录

企业级MA消息推送服务

1)介绍

MAServer提供了基于UPush(http://upush.yyuap.com/sender/login.do) 引擎的一套消息服务和API。这个功能是MAServer 2.7的功能,如果要在低于MA Server 2.7的版本上使用,需要打支持消息推送的补丁

2)API

2.1)发送消息(USERKEY,USERNAME,APPID,设备标示,消息,延时,有效时间)

  1. boolean pushMessage(String username, String userkey, int appid, String deviceid, Message message, int delay, int effecDays)

2.2)发送批量消息(USERKEY,USERNAME,APPID,消息)

  1. boolean pushBatchMessage(String username, String userkey, int appid,Message message)

2.3)设置用户与设备标示关系(APPID,用户,设备标示,有效天数)

  1. void setRelation(int appid, String usercode, String deviceid, int effecDays)

2.4)解除用户与设备标示关系(APPID,用户,设备标示)

  1. void removeRelation(int appid, String usercode, String deviceid)

2.5)根据APPID和用户获取设备标示(APPID,用户)

  1. List<DeviceidVO> getDeviceidsByAppidAndUser(int appid, String user)

2.6)根据APPID过获取用户数(APPID)

  1. int getUserCountByAppid(int appid)

2.7)根据APPID获取用户列表(APPID,int begin,int end)

  1. List<String> getUserByAppid(int appid,int begin, int end)

2.8)根据APPID获取用户列表(APPID)

  1. List<String> getUserByAppid(int appid)

3)配置

在home/conf/configure/ma下新建一个文件夹,该文件夹的名字为你请求参数中servicecontext中的appid的”ma/”之后的部分。此文件夹下面需要有三个配置文件,分别为datasource.xml、provider.xml、services.xml。我们以A0E008.nc.yonyou.com作为appid,configure下的目录结构如下

blob.png

下面分别说明

datasource.xml,dsset为空

blob.png

provider.xml,provider id为ma,表示本地调

blob.png

services.xml里配置的是你要调用的MA Server的内部接口,id为请求参数中的serviceid,provider请填写 ma,method为接口方法名,returntype为返回值类型,params为参数类型,用|分开,interface为要调用的ma接口名,security为是否需要token

blob.png

4)代码实例

blob.png

文档更新时间: 2018-01-16 10:04