ICHMSPushProvider

getPushToken

This method is called to gets the current device push token.

  Syntax: public static String getPushToken()

String pushToken = ICHMSPushProvider.getPushToken();

processPushToken

This method is called to handle new push registration token.

Syntax: public static void processPushToken() throws ICException

Throws an ICException if a user is not registered with IMIconnect or if Push feature is not enabled.

Parameters:

Parameter

Type

Description

RemoteMessage

com.huawei.hms.push.RemoteMessage

A remote HMS Message

try {  
   ICHMSPushProvider.processPushToken();  
}  
catch (ICException e) {  
   Log.e("processPushToken", exception.getLocalizedMessage(), exception);  
}

📘

Note:

This method call required only if application developer implements their own HmsMessageService and requires to receive push messages from connect platform.

processPushMessage (Deprecated)

This method is called to handle push messages received from imiconnect platform.

Syntax: public void processPushMessage(RemoteMessage message) throws ICException

Throws an ICException if a user is not registered with IMIconnect or if Push feature is not enabled or if message is not from imiconnect platform.

try {  
   ICHMSPushProvider.processPushMessage(remoteMessage);  
} catch (ICException exception) {  
   Log.e("processPushMessage ", exception.getLocalizedMessage(), exception);  
}

📘

Note:

This method call required only if application developer implements their own FirebaseMessagingService and requires connect SDK to process the push message received from connect platform.

processPushData

This method is called to handle push message received from connect platform.

Syntax:  void processPushData(Map<String,String> data) throws ICException

Parameters: 

Parameter

Type

Description

data

Map<String,String>

The message data map.

📘

Note

This method call required only if application developer implements their own HmsMessageService
and requires connect SDK to process the push message received from connect platform.

try 
{ 
   ICHMSPushProvider.processPushData(remoteMessage.getDataOfMap()); 
} 
catch (ICException exception) 
{ 
     Log.e("processPushData", exception.getLocalizedMessage(), exception); 
}

isConnnectPushMessage (Deprecated)

This helper method returns whether the message is from the imiconnect platform or not.

Syntax: public boolean isConnnectPushMessage(RemoteMessage message)

Return Value:  Returns true if the message is from connect platform false otherwise.

isConnectPushData

This helper method returns whether the message is from the imiconnect platform or not.

Syntax:  void isConnectPushData(Map<String,String> data)

Parameters:

Parameter

Type

Description

data

Map<String,String>

The message data map.

Returns: Returns true if the message is from connect platform false otherwise.

addPushTokenListener

This method is allows to add an object which implements the ICPushTokenListener interface to listen for updated token.

  Syntax: public static void addPushTokenListener(final ICPushTokenListener listener)

  Parameters:

Parameter

Type

Description

listener

ICPushTokenListener

Push token listener

ICHMSPushProvider.addPushTokenListener(new ICPushTokenListener()  
{  
   @Override  
   public void onNewPushToken(final String pushToken)  
   {  
      Log.d(TAG, "onNewPushToken(): " + pushToken);  
   }  
});

removePushTokenListener

This method is allows the developer to remove a previously added object which implements the ICPushTokenListener interface, in order to stop listening for updated token.

Syntax: public static void removePushTokenListener(final ICPushTokenListener listener)

Parameters:

Parameter

Type

Description

listener

ICPushTokenListener

Push token listener

ICFormField

This class represents formField data for form attachment

getType

This method is used to get the formField type (Text/Name/Email/Integer/Decimal/Date/Dropdown)

Syntax: public ICFormFieldType getType()

Returns: formField Type

setType

This method sets the type of the FormField.

Syntax: public void setType(ICFormFieldType type)

Parameters: type - type of the formField

getName

This method is used to get the formField name

Syntax: ``public java.lang.String getName()

Returns: formField name

setName

This method sets the name of the FormField.

Syntax: public void setName(java.lang.String name)

Parameters: name - name of the FormField

getLabel

This method is used to get the formField label

Syntax: public java.lang.String getLabel()

Returns: formField label

setLabel

This method sets the label of the FormField.

Syntax: public void setLabel(java.lang.String label)

Parameters: label - formField label

getValue

This method is used to get the formField Value

Syntax: public java.lang.String getValue()

Returns: formField Value from user

setValue

This method sets the value of the FormField from user.

Syntax: public void setValue(java.lang.String value)

Parameters: value - formField value from user

getDescription

This method is used to get the formField description

Syntax: public java.lang.String getDescription()

Returns: formField description

setDescription

This method sets the description of the FormField.

Syntax: public void setDescription(java.lang.String description)

Parameters: description -

getMandatory

This method returns whether it is mandatory for user to fill FormField value.

Syntax: public java.lang.Boolean getMandatory()

Returns: Returns true if it is mandatory for the current user to fill formField value.

setMandatory

This method sets whether it is mandatory to fill form field value or not.

Syntax: public void setMandatory(java.lang.Boolean mandatory)

Parameters: mandatory - - true if it is mandatory for the current user to fill form field value

getOptions

This method is used to get the options for FormField type "Dropdown"

Syntax: public java.util.List<java.lang.String> getOptions()

Returns: options for formField Type "dropdown"

setOptions

This method sets options for FormField type "dropdown"

Syntax: public void setOptions(java.util.List<java.lang.String> options)

Parameters: options - - options for formField Type "dropdown"

toJSON

This method returns a new JSONObject instance containing form field data.

Syntax: public JSONObject toJSON() throws JSONException

Returns: A JSONObject representation of the form field data.

Throws: org.json.JSONException

fromJSON

Instantiates a new ICFormField instance from the supplied JSONObject.

Syntax: public static ICFormField fromJSON(org.json.JSONObject jsonObject)

Parameters: jsonObject - A valid JSONObject instance containing form field data.

Returns: A new ICFormField or null if jsonObj is null.

ICTemplateAttachment

This class represents template attachment.

getTemplateType

This method is used to get the template type

Syntax: public ICTemplateType getTemplateType()

Returns: type of template

setTemplateType

This method sets the template type

Syntax: public void setTemplateType(ICTemplateType templateType)

Parameters: templateType - - type of template

getTemplateId

This method returns the template Id .

Syntax: public java.lang.String getTemplateId()

Returns: Returns the Id for the template.

setTemplateId

This method sets the template Id

Syntax: public void setTemplateId(java.lang.String mTemplateId)

Parameters: mTemplateId - the Id for the template

toJSON

This method returns a new JSONObject instance containing template attachment data.

Syntax: public org.json.JSONObject toJSON()
throws org.json.JSONException

Returns: A JSONObject representation of the template attachment data.

Throws: org.json.JSONException

fromJSON

Instantiates a new ICTemplateAttachment instance from the supplied JSONObject.

Syntax: public static ICTemplateAttachment fromJSON(org.json.JSONObject jsonObject)

Parameters: jsonObject - A valid JSONObject instance containing template attachment data.

Returns: A new ICTemplateAttachment or null if jsonObj is null.

ICFormTemplateAttachment

This class represents Form template attachment.

toJSON

This method returns a new JSONObject instance containing form template attachment data.

Syntax: public org.json.JSONObject toJSON()
throws org.json.JSONException

Overrides: toJSON in class ICTemplateAttachment

Returns: A JSONObject representation of the form template attachment data.

Throws: org.json.JSONException

fromJSON

Instantiates a new ICFormTemplateAttachment instance from the supplied JSONObject.

Syntax: public static ICFormTemplateAttachment fromJSON(org.json.JSONObject jsonObject)

Parameters: jsonObject - A valid JSONObject instance containing form template attachment data.

Returns: A new ICFormTemplateAttachment or null if jsonObj is null.

getTitle

This method returns the form template attachment title.

Syntax: public java.lang.String getTitle()

Returns: the form template attachment title

setTitle

This method Sets the form template attachment title

Syntax: public void setTitle(java.lang.String title)

Parameters: title - form template attachment title

getFields

This method returns list of form field data.

Syntax: public java.util.List<ICFormField> getFields()

Returns: list of form field data

setFields

This method Sets list of form field data

Syntax: public void setFields(java.util.List<ICFormField> fields)

Parameters: fields - list of form field data

ICInteractiveData

This class represents the data for user interaction on message

getType

This method is used to get the interactive data type for message

Syntax: public ICInteractiveDataType getType()

Returns: interactive data type for message

setType

This method sets the type of the Interactive Data.

Syntax: public void setType(ICInteractiveDataType type)

Parameters: type - type of the Interactive Data

getSubmittedAt

Returns the date on which the interaction data was submitted to the imiconnect platform.

Syntax: public java.util.Date getSubmittedAt()

Returns: interaction data submitted date

setSubmittedAt

Sets the date on which the interaction data was submitted to the imiconnect platform

Syntax: public void setSubmittedAt(java.util.Date submittedAt)

Parameters: submittedAt - The date on which the message interaction data was submitted.

setTid

This method sets the transaction id for form response message.

Syntax: public void setTid(java.lang.String tid)

Parameters: tid  - transaction id that uniquely identifies the form response message

getPayload

This method gets interactive payload data

Syntax: public org.json.JSONObject getPayload()

Returns: interactive payload data

toJSON

This method returns a new JSONObject instance containing message interactive data.

Syntax: public org.json.JSONObject toJSON()
throws org.json.JSONException

Returns: A JSONObject representation of the message interactive data.

Throws: org.json.JSONException

fromJSON

Instantiates a new ICInteractiveData instance from the supplied JSONObject.

Syntax: public static ICInteractiveData fromJSON(org.json.JSONObject jsonObject)

Parameters: jsonObject - A valid JSONObject instance containing message interactive data.

Returns: A new ICInteractiveData or null if jsonObj is null.