如何检索Android应用程序使用解析在推送通知parseusers名单 [英] How to retrieve list of parseusers in push notification using Parse in Android App

查看:158
本文介绍了如何检索Android应用程序使用解析在推送通知parseusers名单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们是新推的通知概念,我们已经安装了我们的应用程序分为三个手机和放大器;名字被注册在诸如选项卡,SAM,索尼解析服务器名称。
现在,我们需要在一个列表中获得三个名字。
我们尝试,但我们没有运气!

We are new to push notification concept,we have installed our App into three mobiles & names are registered in parse server names like tab,sam,sony. Now we need to get three names in one list. we tried but we don't have luck!

JSONObject i1=ParseInstallation.getCurrentInstallation().getJSONObject("user");//user is key in parse
             System.out.println("users "+i1);

另一种方式

 ParseObject pa1=(ParseObject) ParseObject.fetchAll("user");

我们需要的,我们需要基于名称fromUI单独发送推送通知所有用户parse.Because registred。

we need all user registred in parse.Because we need to send push notification individually based on name fromUI.

请告诉我,如果有可能或没有。
如果可能的话引导我.....!

Please tell me if it is possible or not. if possible guide me.....!

推荐答案

现在我明白你的问题。所以,你要查询的解析安装表和检索用户列值。您可以通过书面形式,你必须对用户Parse.Installation查询云的功能实现这一目标。例如低于code查询安装表并检索所有用户列值;

Now I understand your question. So, you want to query the Parse Installation table and retrieve the user column values. You can achieve this via writing a cloud function where you have to user Parse.Installation query. For example below code query the Installation table and retrieve all of user column values;

    Parse.Cloud.define("getUsers", function(request, response) 
{

  Parse.Cloud.useMasterKey();
  var query = new Parse.Query(Parse.Installation);
  var usernameList = "";
  query.find({
  success: function(results){
     for (var i = 0; i < results.length; i++) 
     { 
        usernameList += results[i].get('user')+"~";
     }
     response.success(usernameList);
    },
    error: function(error) {
     //error
     console.log("error: " + error);
     response.error(error);
    }
  });
});

您可以写这个云功能,您解析云,你可以触发从你的android应用此功能。以上code会产生的用户名〜分开。你可以看一下解析教程钻研云的功能和如何从Android应用程序触发云功能。希望这有助于。

You can write this cloud function to your Parse cloud and you can trigger this function from your android application. The above code will produce the users name with ~ separated. You can look the Parse tutorials to dig into Cloud function and how to trigger cloud function from your android application. Hope this helps.

问候。

这篇关于如何检索Android应用程序使用解析在推送通知parseusers名单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆