use of com.applozic.mobicomkit.MultipleChannelFeedApiResponse 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;
}
Aggregations