美文网首页
Leancloud的消息推送

Leancloud的消息推送

作者: 点滴回忆 | 来源:发表于2016-05-19 16:54 被阅读1148次

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 {
    
            }
        }
    });

相关文章

网友评论

      本文标题:Leancloud的消息推送

      本文链接:https://www.haomeiwen.com/subject/awsgrttx.html