IMIconnect Developer Hub

Welcome to the IMIconnect Developer Hub. You'll find all the resources to help you get started with IMIconnect quickly. We are here to support you if you get stuck. Let's jump right in!

Get Started    API Reference

Callbacks

ICCreateThreadCallback

Used to receive the result of calls to the asynchronous ICMessaging.createThread method.

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.

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.

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.

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.

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

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.

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.

ICShutdownCallback

Used to determine when SDK shutdown is complete.

Return Type
Method

onShutdownComplete


Invoked when the shutdown is complete.

  Syntax: void onShutdownComplete()

ICSubscribeTopicCallback

Used to receive the result of topic subscription operations made via ICMessaging.subscribeTopic.

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.

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

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

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.

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.

Updated 2 days ago

Callbacks


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.