use of com.applozic.mobicomkit.feed.ChannelFeed in project Applozic-Android-SDK by AppLozic.
the class ChannelClientService method getChannelInfoByParameters.
public ChannelFeed getChannelInfoByParameters(String parameters) {
String response = "";
try {
response = httpRequestUtils.getResponse(getChannelInfoUrl() + "?" + parameters, "application/json", "application/json");
ChannelFeedApiResponse channelFeedApiResponse = (ChannelFeedApiResponse) GsonUtils.getObjectFromJson(response, ChannelFeedApiResponse.class);
Utils.printLog(context, TAG, "Channel info response is :" + response);
if (channelFeedApiResponse != null && channelFeedApiResponse.isSuccess()) {
ChannelFeed channelFeed = channelFeedApiResponse.getResponse();
return channelFeed;
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
use of com.applozic.mobicomkit.feed.ChannelFeed in project Applozic-Android-SDK by AppLozic.
the class ChannelClientService method getMembersFromContactGroup.
public ChannelFeed getMembersFromContactGroup(String contactGroupId) {
String response;
if (!TextUtils.isEmpty(contactGroupId)) {
String url = String.format(getMembersFromContactGroupUrl(), contactGroupId);
response = httpRequestUtils.getResponse(url, "application/json", "application/json");
ChannelFeedApiResponse channelFeedApiResponse = (ChannelFeedApiResponse) GsonUtils.getObjectFromJson(response, ChannelFeedApiResponse.class);
if (channelFeedApiResponse != null && channelFeedApiResponse.isSuccess()) {
ChannelFeed channelFeed = channelFeedApiResponse.getResponse();
return channelFeed;
}
}
return null;
}
use of com.applozic.mobicomkit.feed.ChannelFeed in project Applozic-Android-SDK by AppLozic.
the class ChannelClientService method createMultipleChannels.
public List<ChannelFeed> createMultipleChannels(List<ChannelInfo> channels) {
List<ChannelFeed> channelFeeds = null;
try {
String jsonFromObject = GsonUtils.getJsonFromObject(channels, new TypeToken<List<ChannelInfo>>() {
}.getType());
String createChannelResponse = httpRequestUtils.postData(getCreateMultipleChannelUrl(), "application/json", "application/json", jsonFromObject);
Utils.printLog(context, TAG, "Create Multiple channel Response :" + createChannelResponse);
MultipleChannelFeedApiResponse channelFeedApiResponse = (MultipleChannelFeedApiResponse) GsonUtils.getObjectFromJson(createChannelResponse, MultipleChannelFeedApiResponse.class);
if (channelFeedApiResponse != null && channelFeedApiResponse.isSuccess()) {
channelFeeds = channelFeedApiResponse.getResponse();
}
} catch (Exception e) {
e.printStackTrace();
return null;
}
return channelFeeds;
}
use of com.applozic.mobicomkit.feed.ChannelFeed in project Applozic-Android-SDK by AppLozic.
the class ChannelService method getMembersFromContactGroupList.
public ChannelFeed[] getMembersFromContactGroupList(List<String> groupIdList, List<String> groupNames, String groupType) {
List<ChannelFeed> channelFeedList;
ChannelFeedListResponse channelFeedListResponse = channelClientService.getMemebersFromContactGroupIds(groupIdList, groupNames, groupType);
if (channelFeedListResponse != null && channelFeedListResponse.getStatus().equals(ChannelFeedListResponse.SUCCESS)) {
channelFeedList = channelFeedListResponse.getResponse();
processChannelFeedList(channelFeedList.toArray(new ChannelFeed[channelFeedList.size()]), false);
return channelFeedList.toArray(new ChannelFeed[channelFeedList.size()]);
}
return null;
}
use of com.applozic.mobicomkit.feed.ChannelFeed in project Applozic-Android-SDK by AppLozic.
the class ChannelService method getChannelInfo.
public Channel getChannelInfo(String clientGroupId) {
if (TextUtils.isEmpty(clientGroupId)) {
return null;
}
Channel channel = channelDatabaseService.getChannelByClientGroupId(clientGroupId);
if (channel == null) {
ChannelFeed channelFeed = channelClientService.getChannelInfo(clientGroupId);
if (channelFeed != null) {
channelFeed.setUnreadCount(0);
ChannelFeed[] channelFeeds = new ChannelFeed[1];
channelFeeds[0] = channelFeed;
processChannelFeedList(channelFeeds, false);
channel = getChannel(channelFeed);
return channel;
}
}
return channel;
}
Aggregations