I am trying to publish an object and its returning read timeout exception everytime.
Here is my code
PublishOptions publishOptions = new PublishOptions();
publishOptions.putHeader("android-ticker-text","New Chat");
publishOptions.putHeader("android-content-title","New chat from "+accPrefs.getName());
publishOptions.putHeader("android-content-text",newMessage.getMessage());
Backendless.Messaging.publish("chat", newMessage, publishOptions, new AsyncCallback<MessageStatus>() {
@Override
public void handleResponse(MessageStatus messageStatus) {
chatMessages.add(newMessage);
adapter.notifyDataSetChanged();
Log.v("publish message", "Success");
send_chat.setVisibility(View.VISIBLE);
}
@Override
public void handleFault(BackendlessFault backendlessFault) {
send_chat.setVisibility(View.VISIBLE);
Toast.makeText(getContext(),"Cannot send,check your internet connection and try again",Toast.LENGTH_LONG).show();
Log.v("publish message", "fail " + backendlessFault.getMessage());
}
});