Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何在AppLozic中获取我的用户列表_Android_Firebase_Applozic - Fatal编程技术网

Android 如何在AppLozic中获取我的用户列表

Android 如何在AppLozic中获取我的用户列表,android,firebase,applozic,Android,Firebase,Applozic,是否有可能获得我的所有用户,而无需将他们添加到联系人中。我的问题是,我将用户存储在Firebase中,他们可以拥有不可见的配置文件。我只需要获得具有可见配置文件的用户。我怎样才能做到这一点 谢谢您可以使用下面的方法代码获取所有用户。您需要传递set类型的用户,然后如果(!TextUtils.isEmpty(response)){ public String postUserDetailsByUserIds(Set<String> userIds) { try {

是否有可能获得我的所有用户,而无需将他们添加到联系人中。我的问题是,我将用户存储在Firebase中,他们可以拥有不可见的配置文件。我只需要获得具有可见配置文件的用户。我怎样才能做到这一点


谢谢

您可以使用下面的方法代码获取所有用户。您需要传递set类型的用户,然后如果(!TextUtils.isEmpty(response)){

public String postUserDetailsByUserIds(Set<String> userIds) {
    try {
        HttpRequestUtils httpRequestUtils =    new HttpRequestUtils(this);
       final  String userDetailsUrl = "https://apps.applozic.com/rest/ws/user/detail";
        if (userIds !=null && userIds.size()>0  ) {
            List<String> userDetailsList = new ArrayList<>();
            String response = "";
            int count = 0;
            for (String userId : userIds) {
                count++;
                userDetailsList.add(userId);
                if( count% 60==0){
                    UserDetailListFeed userDetailListFeed = new UserDetailListFeed();
                    userDetailListFeed.setContactSync(true);
                    userDetailListFeed.setUserIdList(userDetailsList);
                    String jsonFromObject = GsonUtils.getJsonFromObject(userDetailListFeed, userDetailListFeed.getClass());
                    Log.i(TAG,"Sending json:" + jsonFromObject);
                    response = httpRequestUtils.postData(userDetailsUrl + "?contactSync=true", "application/json", "application/json", jsonFromObject);
                    userDetailsList =  new ArrayList<String>();
                    if(!TextUtils.isEmpty(response)){
                            List<UserDetail> userDetails = (List<UserDetail>) GsonUtils.getObjectFromJson(response, new TypeToken<List<UserDetail>>() {}.getType());
                            for (UserDetail userDetail : userDetails) {
                                //Here you will get the user details
                                Log.i("UserDeatil","userId:"+userDetail.getUserId()) ;

                                Log.i("UserDeatil","display name:"+userDetail.getDisplayName()) ;

                                Log.i("UserDeatil","image link:"+userDetail.getImageLink()) ;

                                Log.i("UserDeatil","phone number:"+userDetail.getPhoneNumber()) ;
                            }
                    }
                }
            }
            if(!userDetailsList.isEmpty()&& userDetailsList.size()>0) {
                UserDetailListFeed userDetailListFeed = new UserDetailListFeed();
                userDetailListFeed.setContactSync(true);
                userDetailListFeed.setUserIdList(userDetailsList);
                String jsonFromObject = GsonUtils.getJsonFromObject(userDetailListFeed, userDetailListFeed.getClass());
                response = httpRequestUtils.postData(userDetailsUrl + "?contactSync=true", "application/json", "application/json", jsonFromObject);

                Log.i(TAG, "User details response is :" + response);
                if (TextUtils.isEmpty(response) || response.contains("<html>")) {
                    return null;
                }

                if (!TextUtils.isEmpty(response)) {
                    List<UserDetail> userDetails = (List<UserDetail>) GsonUtils.getObjectFromJson(response, new TypeToken<List<UserDetail>>() {}.getType());
                    for (UserDetail userDetail : userDetails) {

                        //Here you will get the user details 
                        Log.i("UserDeatil","userId:"+userDetail.getUserId()) ;

                        Log.i("UserDeatil","display name:"+userDetail.getDisplayName()) ;

                        Log.i("UserDeatil","image link:"+userDetail.getImageLink()) ;

                        Log.i("UserDeatil","phone number:"+userDetail.getPhoneNumber()) ;
                    }                    }
            }
            return response;
        }

    } catch (Exception e) {
        e.printStackTrace();
    }
    return null;
}
公共字符串positionrDetailsBySerID(设置用户ID){
试一试{
HttpRequestUtils HttpRequestUtils=新的HttpRequestUtils(此);
最终字符串userDetailsUrl=”https://apps.applozic.com/rest/ws/user/detail";
if(userIds!=null&&userIds.size()>0){
List userDetailsList=new ArrayList();
字符串响应=”;
整数计数=0;
for(字符串userId:userId){
计数++;
userDetailsList.add(userId);
如果(计数%60==0){
UserDetailListFeed UserDetailListFeed=新的UserDetailListFeed();
userDetailListFeed.setContactSync(true);
userDetailListFeed.setUserIdleList(userDetailsList);
字符串jsonFromObject=GsonUtils.getJsonFromObject(userDetailListFeed,userDetailListFeed.getClass());
i(标记“发送json:+jsonFromObject”);
response=httpRequestUtils.postData(userDetailsUrl+“?contactSync=true”、“application/json”、“application/json”、jsonFromObject);
userDetailsList=新的ArrayList();
如果(!TextUtils.isEmpty(响应)){
List userDetails=(List)GsonUtils.getObjectFromJson(响应,new-TypeToken(){}.getType());
for(UserDetail UserDetail:userDetails){
//在这里您将获得用户详细信息
Log.i(“UserDeatil”,“userId:+userDetail.getUserId());
Log.i(“UserDeatil”,“显示名称:”+userDetail.getDisplayName());
Log.i(“UserDeatil”,“image link:+userDetail.getImageLink());
Log.i(“UserDeatil”,“电话号码:”+userDetail.getPhoneNumber());
}
}
}
}
如果(!userDetailsList.isEmpty()&&userDetailsList.size()>0){
UserDetailListFeed UserDetailListFeed=新的UserDetailListFeed();
userDetailListFeed.setContactSync(true);
userDetailListFeed.setUserIdleList(userDetailsList);
字符串jsonFromObject=GsonUtils.getJsonFromObject(userDetailListFeed,userDetailListFeed.getClass());
response=httpRequestUtils.postData(userDetailsUrl+“?contactSync=true”、“application/json”、“application/json”、jsonFromObject);
Log.i(标记“用户详细信息响应为:”+响应);
if(TextUtils.isEmpty(response)| | response.contains(“”){
返回null;
}
如果(!TextUtils.isEmpty(响应)){
List userDetails=(List)GsonUtils.getObjectFromJson(响应,new-TypeToken(){}.getType());
for(UserDetail UserDetail:userDetails){
//在这里您将获得用户详细信息
Log.i(“UserDeatil”,“userId:+userDetail.getUserId());
Log.i(“UserDeatil”,“显示名称:”+userDetail.getDisplayName());
Log.i(“UserDeatil”,“image link:+userDetail.getImageLink());
Log.i(“UserDeatil”,“电话号码:”+userDetail.getPhoneNumber());
}                    }
}
返回响应;
}
}捕获(例外e){
e、 printStackTrace();
}
返回null;
}

您是在android、ios还是web中集成聊天功能?我在android中集成聊天功能。调用ApplozicSetting.getInstance(context.enableRegisteredUserContactCall()是否可能?在添加applozic-settings.json文件后,按照此链接将josn文件添加到您的应用程序中,使registeredUserContactListCall:true,startNewButton:true,然后单击工具栏中的(+)加号按钮加载所有注册用户