Callbacks
This section details the callback and listener interfaces contained within the com.imimobile.connect.core.callbacks
package.
- ICCreateThreadCallback
- ICFetchMessagesCallback
- ICFetchStreamsCallback - Removed in 2.7.0
- ICFetchThreadsCallback
- ICFetchTopicsCallback
- ICFileDownloadCallback
- ICFileUploadCallback
- ICMessagingListener
- ICPublishMessageCallback
- ICRegistrationCallback
- ICSecurityTokenExceptionListener
- ICSetMessageStatusCallback
- ICStartupCallback
- ICShutdownCallback
- ICSubscribeTopicCallback
- ICUnsubscribeTopicCallback
- ICUpdateProfileDataCallback
- ICUpdateThreadCallback
- ICUserAuthenticationCallback
- ICPublishEventCallback
- ICDeleteMessageCallback
- ICPushTokenListener
ICCreateThreadCallback
Used to receive the result of calls to the asynchronous ICMessaging.createThread method.
Return Type | Method |
---|---|
void | onCreateThreadComplete(ICThread thread, ICException exception) |
onCreateThreadComplete
Invoked when the ICMessaging.createThread method completes execution. If an error occurs the exception parameter will not be null.
āāSyntax: void onCreateThreadComplete(ICThread thread, ICException exception);
āāParameters:
Parameter | Type | Description |
---|---|---|
thread | The thread object that was provisioned within the imiconnect platform. | |
exception | Null if the operation succeeded. |
ICFetchMessagesCallback
Used to receive the result of calls to the asynchronous ICMessaging.fetchMessages method.
onFetchMessagesComplete
Invoked when the ICMessaging.fetchMessages completes execution. If an error occurs then the exception parameter will not be null.
āāSyntax: onFetchMessagesComplete(ICMessage[] messages, boolean hasMoreData, ICException exception);
āāParameters:
Parameter | Type | Description |
---|---|---|
messages | The fetched messages array | |
hasMoreData | boolean | A value of true signifies that additional messages exist within the platform that matched the initial fetch criteria. |
exception | Null if the operation succeeded. |
ICFetchStreamsCallback
Removed since v2.7.0.
Used to receive the result of the asynchronous ICMessaging.fetchStreams method.
Return Type | Method |
---|---|
void | onFetchStreamsComplete(ICStream[] streams, ICException exception) |
onFetchStreamsComplete
Invoked when calls to the ICMessaging.fetchStreams method completes execution. If an error occurs, then the exception parameter will not be null.
āāSyntax: void onFetchStreamsComplete(ICStream[] streams, ICException exception);
āāParameters:
Parameter | Type | Description |
---|---|---|
streams | ICStream[] | Array of streams fetched from the imiconnect platform. |
exception | Null if the operation succeeds. |
ICFetchThreadsCallback
Used to receive the result of the asynchronous ICMessaging.fetchThreads method.
onFetchThreadsComplete
Invoked when execution of ICMessaging.fetchThreads completes. If an error occurs then the exception parameter will not be null.
āāSyntax: void onFetchThreadsComplete(ICThread[] threads, boolean hasMoreData, ICException exception);
āāParameters:
Parameter | Type | Description |
---|---|---|
threads | Array of threads fetched from the imiconnect platform. | |
hasMoreData | boolean | A value of true signifies that additional threads exist within the platform that matched the initial fetch criteria. |
exception | Null if the operation was successful. |
ICFetchTopicsCallback
Used to receive the result of the asynchronous ICMessaging.fetchTopics method.
Return Type | Method |
---|---|
void | onFetchTopicsComplete(ICTopic[] topics, boolean hasMoreData, ICException exception) |
onFetchTopicsComplete
Invoked when execution of ICMessaging.fetchTopics is complete. If an error occurs, then the exception parameter will be non-null.
āāSyntax: void onFetchTopicsComplete(ICTopic[] topics, boolean hasMoreData, ICException exception)
āāParameters:
Parameter | Type | Description |
---|---|---|
topics | Array of topics fetched from the platform. | |
hasMoreData | boolean | A value of true signifies that additional threads exist within the platform that matched the initial fetch criteria. |
exception | Null if the operation was successful. |
ICFileDownloadCallback
Used when downloading files with ICMediaFileManager to receive events related to progress and completion.
onFileDownloadComplete
Invoked when a download completes or has failed.
āāSyntax: onFileDownloadComplete(URL url, File file, ICException exception)
āāParameters:
Parameter | Type | Description |
---|---|---|
url | URL | The URL of the download. |
file | File | The downloaded file. Null if an error occurred. |
exception | Non-null if an error occurred. |
onFileDownloadProgress
Invoked to report the progress of a download operation.
āāSyntax: onFileDownloadProgress(URL url, long bytesDownloaded, long bytesTotal)
āParameters:
Parameter | Type | Description |
---|---|---|
url | URL | The URL of the download. |
bytesDownloaded | long | The number of bytes that have been downloaded so far. |
bytesTotal | long | The total number of bytes for the download. |
ICFileUploadCallback
Used when uploading files with ICMediaFileManager to receive events related to progress and completion.
onFileUploadComplete
Invoked when upload completes or has failed.
āāSyntax: onFileUploadComplete(File file, String mediaId, ICException exception)
āāParameters:
Parameter | Type | Description |
---|---|---|
file | File | The local file that was uploaded. |
mediaId | String | The identifier of the upload within the imiconnect platform. Will be null if the upload failed. |
exception | Non-null if an error occurred during upload. |
onFileUploadProgress
Invoked to report the progress of a file upload operation.
āāSyntax: onFileUploadProgress(File file, long bytesUploaded, long bytesTotal)
āāParameters:
Parameter | Type | Descriptio |
---|---|---|
file | File | The local file that is being uploaded. |
bytesUploaded | long | The number of bytes that have been uploaded so far. |
bytesTotal | long | The total number of bytes for the upload operation. |
ICMessagingListener
Interface for listening to events from the ICMessaging class.
onConnectionStatusChanged
Invoked when there is a change to the In-App Messaging connection status. If an error has occurred (status == .Error) the exception parameter will be non-null.
āāSyntax: void onConnectionStatusChanged(ICConnectionStatus status, ICException exception)
.
Parameter
Parameter | Type | Description |
---|---|---|
status | The current connection status. | |
exception | Non-null if an error has occurred. |
onMessageReceived
Invoked when a new In-App Message is received from the imiconnect platform.
āāSyntax: void onMessageReceived(ICMessage message)
.
Parameter
Parameter | Type | Description |
---|---|---|
message | The received message. |
ICPublishMessageCallback
Used to receive the result of messages published via ICMessaging.publishMessage.
Return Type | Method |
---|---|
void | onPublishMessageComplete(ICMessage message, ICException exception) |
onPublishMessageComplete
Invoked to report the result of publishing an In-App Message. If an error occurs then the exception parameter will not be null.
āāSyntax: void onPublishMessageComplete(ICMessage message, ICException exception)
āāParameters:
Parameter | Type | Description |
---|---|---|
message | The message that was being published. | |
exception | Non-null if an exception occurred. |
ICRegistrationCallback
Used to receive the result of calls to imiconnect.register.
Return Type | Method |
---|---|
void | onRegistrationComplete(Bundle bundle, ICException exception) |
onRegistrationComplete
Invoked to report the result of user registration. If an error occurs then the exception parameter will not be null.
The bundle parameter is reserved for future use to return registration-related information.
āāSyntax: void onRegistrationComplete(Bundle bundle, ICException exception)
āāParameters:
Parameter | Type | Description |
---|---|---|
bundle | Bundle | Reserved for future use. |
exception | Non-null if an exception occurs. |
ICSecurityTokenExceptionListener
Used for listening to Security Token exceptions that occur from API calls to the imiconnect Platform.
Return Type | Method |
---|---|
void |
onException
Invoked whenever a Security Token exception occurs, the ICException object contains cause information.
āāSyntax: void onException(ICException exception)
āāParameters:
Parameter | Type | Description |
---|---|---|
exception | Describes the cause of the error. |
ICSetMessageStatusCallback
Used to receive the result of message status updates for ICMessaging.setMessageAsRead and ICMessaging.setMessagesAsRead.
Return Type | Method |
---|---|
void | onSetMessageStatusComplete(String[] messageTransactionIds, ICException exception) |
onSetMessageStatusComplete
Invoked to report the result of updating message statuses. If an error occurs then the exception parameter will be non-null.
āāSyntax: void onSetMessageStatusComplete(String[] messageTransactionIds, ICException exception)
āāParameters:
Parameter | Type | Description |
---|---|---|
messageTransactionIds | String[] | An array of messages ids on which the operation was performed. |
exception | Null if the operation succeeded. |
ICStartupCallback
This interface contains a single method that is used to notify the caller when the SDK startup is complete.
If the startup failed the ICException parameter will be non-null and contains details of the failure.
public interface ICStartupCallback
{
void onStartupComplete(ICException e);
}
ICShutdownCallback
This interface contains a single method that is used to notify the caller when the SDK shutdown is complete.
If the startup failed the ICException parameter will be non-null and contains details of the failure.
public interface ICShutdownCallback
{
void onShutdownComplete(final ICException e);
}
Return Type | Method |
---|---|
void |
onShutdownComplete
Invoked when the shutdown is complete.
āāSyntax: void onShutdownComplete()
ICSubscribeTopicCallback
Used to receive the result of topic subscription operations made via ICMessaging.subscribeTopic.
Return Type | Method |
---|---|
void | onSubscribeTopicComplete(String topicId, ICException exception) |
onSubscribeTopicComplete
Invoked to report the result of the topic subscription. If the operation succeeds then the exception parameter will be null.
āāSyntax: void onSubscribeTopicComplete(String topicId, ICException exception)
āāParameters:
Parameter | Type | Description |
---|---|---|
topicId | String | The id of the topic for the subscription operation. |
exception | Null if the operation succeeded. |
ICUnsubscribeTopicCallback
Used to receive the result of calls to ICMessaging.unsubscribeTopic
.
Return Type | Method |
---|---|
void | onUnsubscribeTopicComplete(String topicId, ICException exception) |
onUnsubscribeTopicComplete
Invoked to report the result of unsubscribing from a topic. If the operation succeeds, the exception parameter will be null.
āāSyntax: void onUnsubscribeTopicComplete(String topicId, ICException exception)
āāParameters:
Parameter | Type | Description |
---|---|---|
topicId | String | The id of the topic which was being unsubscribed. |
exception | Null if the operation succeeded. |
ICUpdateProfileDataCallback
Used to receive the result of profile update operations made via imiconnect.updateProfileData
Return Type | Method |
---|---|
void |
onUpdateComplete
Invoked to report the result of profile update operations. If the operation succeeds the exception parameter will be null.
āāSyntax: void onUpdateComplete(Bundle bundle, ICException exception)
āāParameters:
Parameter | Type | Description |
---|---|---|
bundle | Bundle | Reserved for future use. |
exception | Null if the operation succeeded. |
ICUpdateThreadCallback
Used to receive the result of calls to ICMessaging.updateThread and ICMessaging.closeThread
Return Type | Method |
---|---|
void | onUpdateThreadComplete(ICThread thread, ICException exception) |
onUpdateThreadComplete
Invoked when the operation completes. If the call was successful the exception parameter will be null.
āāSyntax: void onUpdateThreadComplete(ICThread thread, ICException exception);
āāParameters:
Parameter | Type | Description |
---|---|---|
thread | The thread instance that was being updated / closed. | |
exception | Null if the operation succeeded. |
ICUserAuthenticationCallback
Captures events raised during the various stages of user authentication.
Return Type | Method |
---|---|
void | |
void | |
void | |
void |
onPinGenerated
Invoked when a pin code has been successfully generated by the imiconnect platform, in response to a call of ICUserAuthentication.generatePin.
āāSyntax: void onPinGenerated()
onPinValidated
Invoked when a pin code has been successfully validated. This may occur in response to ICUserAuthentication.validatePin or after automatic pin validation from an incoming SMS when the SDK is in listening mode.
āāSyntax: void onPinValidated()
onPinReceived
Invoked when a pin has been received. This event is only raised when the SDK is listening for incoming SMS.
āāSyntax: void onPinReceived()
onError
Invoked if any stage of the authentication process has failed.
āāSyntax: void onError(ICException exception)
āāParameters:
Parameter | Type | Description |
---|---|---|
exception | Contains error information. |
ICPublishEventCallback
Used to receive the result of messages published via imiconnect.publishEvent
.
onPublishEventComplete
Invoked to report the result of publishing events. If an error occurs then the exception parameter will not be null.
āāSyntax: void onPublishEventComplete(Bundle bundle, ICException exception)
āāParameters:
Parameter | Type | Description |
---|---|---|
bundle | Bundle | The events being published. |
exception | Non-null if an exception occurred. |
ICDeleteMessageCallback
Used to receive the result of delele message operations made via ICMessaging.deleteMessage
.
onDeleteMessageComplete
Invoked to report the result of delete message operations. If the operation succeeds the exception parameter will be null.
āāSyntax: void onDeleteMessageComplete(String messageTransactionId, ICException exception)
āāParameters:
Parameter | Type | Description |
---|---|---|
messageTransactionId | String | Messageās transaction id |
exception | ICException | Null if the operation succeeded. |
ICPushTokenListener
Used for listening to the updated push token.
Return Type | Method |
---|---|
void | onNewToken(String token) |
onNewToken
Called when a new token for the default Firebase project is generated.
āāSyntax: public void onNewToken(String token)
āāParameters:
Parameter | Type | Description |
---|---|---|
token | String | New push token |
ICRegenerateMediaURLCallback
Used to receive the result of calls to the asynchronousāÆICMediaFileManager. regenerateMediaURL method.
onRegenerateMediaURLComplete
Invoked when regenerate media URL is completed/failed.
Syntax:āÆāÆ void onRegenerateMediaURLComplete(URL url, ICException exception)
Parameter | Type | Description |
---|---|---|
url | URL | Media url |
exception | ICException | Non-null if an error occurred. |
Updated 8 months ago