Package com.cometchat.pro.helpers
Class CometChatHelper
- java.lang.Object
-
- com.cometchat.pro.helpers.CometChatHelper
-
public class CometChatHelper extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description CometChatHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Conversation
getConversationFromMessage(BaseMessage message)
static BaseMessage
processMessage(JSONObject messageObject)
This method helps to convertJSONObject
of the message payload obtained from Push Notification
-
-
-
Method Detail
-
processMessage
public static BaseMessage processMessage(JSONObject messageObject) throws JSONException
This method helps to convertJSONObject
of the message payload obtained from Push Notification
- Parameters:
messageObject
-JSONObject
of the message payload
- Returns:
- An object of
BaseMessage
- Throws:
JSONException
- * Thrown to indicate a problem with the JSON API. Such problems include- Attempts to parse or construct malformed documents
- Use of null as a name
- Use of numeric types not available to JSON, such as
NaNs
orinfinities
. - Lookups using an out of range index or nonexistent name
- Type mismatches on lookups
Although this is a checked exception, it is rarely recoverable. Most callers should simply wrap this exception in an unchecked exception and rethrow:
public JSONArray toJSONObject() { try { JSONObject result = new JSONObject(); ... } catch (JSONException e) { throw new RuntimeException(e); } }
-
getConversationFromMessage
public static Conversation getConversationFromMessage(BaseMessage message)
-
-