ICMessagingReceiver
This class allows the interception of incoming messages and connection status changes and provides a hook into the push notification generation process. Inherit from this class to substitute or supplement the default functionality. The receiver, or subclass thereof, must be declared within the Android manifest.
//A sample app manifest entry. If you inherit a class from ICMessagingReceiver, replace the name with your class name.
<receiver
android:name="YOUR_MESSAGE_RECEIVER_NAME"
android:enabled="true"
android:exported="false">
<intent-filter>
<action android:name="com.imimobile.connect.core.rtmevent"/>
<action android:name="com.imimobile.connect.core.notification.click"/>
<action android:name="com.imimobile.connect.core.intent.notification.RECEIVE"/>
</intent-filter>
</receiver>
getNotificationFactory
Override this method to provide a custom ICNotificationFactory
implementation in order to customise notifications. It is recommended that you do not return a new instance every time this method is invoked, instead cache your custom instance and return that.
Syntax: [ICNotificationFactory](https://developers.imiconnect.io/docs/icnotificationfactory) getNotificationFactory()
Return Value:
The default implementation returns the standard ICNotificationFactory instance.
onConnectionStatusChanged
Invoked whenever there is a change to the Live Chat / In-App Messaging connection status. The exception parameter will be populated with error information when status == ICConnectionStatus.Error
.
Syntax: void onConnectionStatusChanged(Context context, ICConnectionStatus status, ICException exception)
Parameters:
Parameter | Type | Description |
---|---|---|
context | Context | Refer to Android Context. |
status | ICConnectionStatus | The new connection status. |
exception | ICException | Non-null if an error has occurred. |
onMessageReceived
Invoked whenever a new Push or Live Chat / In-App Message is received.
Syntax: void onMessageReceived(Context context, ICMessage message)
Parameters:
Parameter | Type | Description |
---|---|---|
context | Context | Refer to Android context. |
message | ICMessage | The incoming Push or In App Message. |
Updated 9 days ago