Helpers
This section contains some useful helper classes that may be used to simplify specific tasks.
ICGooglePlayServicesHelper
Helps manage the Google Play Services dependency via a listener that will be notified when Google Play Services are out of date or missing.
ICGooglePlayServicesHelper
Constructs a GooglePlayServicesHelper instance that may be used to intercept events from Google Play Services.
Syntax: ICGooglePlayServicesHelper()
.
Public Methods | |
---|---|
void | addListener |
void | removeListener |
addListener
Adds a listener.
Note: The listener is held as a strong reference.
Syntax: void addListener(ICGooglePlayServicesHelper.Listener listener)
.
Parameters
Parameter | Type | Description |
---|---|---|
listener | ICGooglePlayServicesHelper.Listener | The listener instance to be added that will be notified for future Google Play Services events. |
removeListener
Removes a previously added listener.
Syntax: void removeListener(ICGooglePlayServicesHelper.Listener listener)
.
Parameter
Parameter | Type | Description |
---|---|---|
listener | ICGooglePlayServicesHelper.Listener | The listener instance that should be removed. |
ICGooglePlayServicesHelper.Listener
Interface for listening to Google Play Services errors.
onAvailabilityError
This method is invoked when Google Play Services availability errors occur.
When an availability error occurs, the GoogleApiAvailability class should be used to determine if a resolution is available and to action the resolution.
SDK functionality may be limited until the Google Play Services error is remedied.
For example, it may not be possible to receive push notification on the affected device.
Syntax: void onAvailabilityError(Context context, GoogleApiAvailability availabilityApi, int errorCode)
.
Parameters:
Parameter | Type | Description |
---|---|---|
context | Context | An Android Context instance. This is always the global application context |
availabilityApi | GoogleApiAvailability | The GoogleApiAvailability instance that may be used to resolve the error. |
errorCode | int | The error code, check GoogleApiAvailability.isGooglePlayServicesAvailable(Context)for details |
ICMessageHelper
This helper class supports specific message operations such as publishing typing indicators.
publishTypingIndicator
Facilitates publication of typing start/stop indicator events to the IMIconnect platform.
Syntax: void publishTypingIndicator(ICThread thread, boolean started)
.
Parameters:
Parameter | Type | Description |
---|---|---|
thread | ICThread | The thread on which the event should occur |
started | boolean | Pass true to indicate a typing start event or false for a stop event. |
Updated almost 2 years ago