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
voidaddListener
voidremoveListener

addListener


Adds a listener.

Note: The listener is held as a strong reference.

  Syntax: void addListener(ICGooglePlayServicesHelper.Listener listener).

Parameters

ParameterTypeDescription
listenerICGooglePlayServicesHelper.ListenerThe 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

ParameterTypeDescription
listenerICGooglePlayServicesHelper.ListenerThe 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:

ParameterTypeDescription
contextContextAn Android Context instance. This is always the global application context
availabilityApiGoogleApiAvailabilityThe GoogleApiAvailability instance that may be used to resolve the error.
errorCodeintThe 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:

ParameterTypeDescription
threadICThreadThe thread on which the event should occur
startedbooleanPass true to indicate a typing start event or false for a stop event.

Copyright © 2000 - 2021 IMImobile Limited | All Rights Reserved