Leancloud的消息推送:
首先要获取用户的设备信息:
其实leancloud的推送就分两块
1:查询
2:推送
AVQuery pushQuery = AVInstallation.getQuery();
//AVQuey 查询要推送的设备信息
pushQuery.whereEqualTo("channels", "public");
//给查询到的设备推送信息
AVPush push = new AVPush();
push.setQuery(pushQuery);
push.setMessage("Push to channel.");
push.setPushToAndroid(true);
push.sendInBackground(new SendCallback() {
@Override
public void done(AVException e) {
if (e == null) {
} else {
}
}
});