wavecell-android-sdk / com.wavecell.android.sdk / Wavecell

Wavecell

open class Wavecell

Wavecell is an SDK facade object. The inception point of all communications between client and SDK.

Types

State

Wavecell state with the string representation of the state.

enum class State

Properties

calls

list of active calls.

val calls: List<VoiceCall>?

componentsVersion

Read-only property returning the String value indicating the Wavecell SDK component versions.

val componentsVersion: String

currentAudioOption

The current audio I/0 option used of type VoiceCallAudioOption

val currentAudioOption: VoiceCallAudioOption

deviceRegistrationLog

Read-only property used to receive registration data used in the SDK.

val deviceRegistrationLog: String

displayName

Read-only property for user's display name.

val displayName: String

hasActiveCalls

Read-only property to check if there are any Active calls at the moment.

val hasActiveCalls: Boolean

inboundCallPath

Read-only property for the inbound call path.

val inboundCallPath: InboundCallPath

phoneNumber

Read-only property for the user's phone number.

val phoneNumber: String?

ringtoneResourceId

Property to get and set the ringtone to be played for an incoming call.

var ringtoneResourceId: Int

sdkVersion

Read-only property returning the String value indicating the Wavecell SDK version.

val sdkVersion: String

userId

Read-only property for user's id.

val userId: String

voiceCall

the current active call.

val voiceCall: VoiceCall?

Functions

activate

Activates the SDK. All fields from both, session and user configurations must be set, otherwise the activation will return a WavecellException by invoking the WavecellConfiguration.failureListener.

fun activate(configuration: WavecellConfiguration): Unit

deactivate

Destroys the internal SDK components. It should be called by app upon user logout.

fun deactivate(completionHandler: CompletionHandler): Unit

handleIncomingCall

Handles an incoming call.

fun handleIncomingCall(data: MutableMap<String, String>, notification: Notification, callActionListener: WavecellCallActionListener? = null, listener: WavecellCallResultListener): Unit

init

Initializes SDK internal components and log listener which when set, will invoke to send some useful logging information to the application. Should be called once per application lifecycle.

fun init(application: Application, listener: WavecellLogListener): Unit

isActivated

Can be called to know if SDK is in active state.

fun isActivated(): Boolean

isWavecellNotification

Checks if the received notification is for Incoming call that the SDK can process.

fun isWavecellNotification(data: MutableMap<String, String>): Boolean

makeCall

Places an outgoing call.

fun makeCall(activity: FragmentActivity? = null, contact: VoiceContact, listener: WavecellCallResultListener): Unit

onDestroy

Clears Disposables on SDK

fun onDestroy(): Unit

registerListenerForCallUpdatesForCallWithUniqueId

Provides updates for a call.

fun registerListenerForCallUpdatesForCallWithUniqueId(callUniqueId: UUID, listener: CallUpdateListener, disposableListener: ((WavecellDisposable) -> Unit)?): Unit

setOnCallMetricEventListener

To be set when application wants to get call metric from the SDK. Invoked with data of type WavecellEvent

fun setOnCallMetricEventListener(listener: (WavecellEvent) -> Unit): Unit

setOnCallReportListener

To be set when application wants to get call report from the SDK. The report is String presentation of Json object.

fun setOnCallReportListener(listener: (String) -> Unit): Unit

setOnPermissionsListener

Listener for missing permissions that are required for the SDK to work properly. It is invoked once per application lifecycle.

fun setOnPermissionsListener(listener: PermissionsListener): Unit

setOnStateChangedListener

Listener invoked when there is an update on the Wavecell.State object.

fun setOnStateChangedListener(listener: WavecellStateListener): Unit

setOnVoiceCallAudioOptionListener

Listener to be set to get updates of audio I/0 change while in a call.

fun setOnVoiceCallAudioOptionListener(listener: VoiceCallAudioOptionListener): Unit

setOnVoiceCallUpdateListener

Listener invoked when there in any updates on a VoiceCall object.

fun setOnVoiceCallUpdateListener(from: String, listener: VoiceCallUpdateListener, disposableListener: ((WavecellDisposable) -> Unit)? = null): Unit

setVoiceAudioOption

Update the audio I/0 used during a call.

fun setVoiceAudioOption(audioOption: VoiceCallAudioOption): Unit

switchAudioOption

Allows to check if Bluetooth is available as an audio option. If so listener is invoked letting you know there is a third audio option, if not it switches between VoiceCallAudioOption.EARPIECE and VoiceCallAudioOption.SPEAKER.

fun switchAudioOption(listener: () -> Unit): Unit

updateAuthenticationToken

Update display authentication token at any point after a successful registration.

fun updateAuthenticationToken(token: String, completionHandler: CompletionHandler): Unit

updateContact

To update contact information on the call object

fun updateContact(callUniqueId: UUID, voiceContact: VoiceContact): Unit

updateDisplayName

Update display name at any point after successful registration

fun updateDisplayName(displayName: String, completionHandler: CompletionHandler): Unit

updateInboundCallPath

Update InboundCallPath at any point after a successful registration.

fun updateInboundCallPath(path: InboundCallPath, completionHandler: CompletionHandler): Unit

updatePhoneNumber

Update phone number at any point after successful registration

fun updatePhoneNumber(phoneNumber: String?, completionHandler: CompletionHandler): Unit

updatePushToken

Updates push token at any point after successful registration

fun updatePushToken(pushChannel: PushNotificationChannel, completionHandler: CompletionHandler): Unit

Companion Object Functions

getInstance

fun getInstance(): Wavecell