var callIntent =BandyerIntent.Builder().startFromJoinCallUrl(currentActivity,"https://....").build()
startActivity(callIntent)
Start a chat
v4
v3
// this will create the unique chat between logged user and "userB"KaleyraVideo.conversation.chat(currentActivity, userId ="userB") :Result<Chat>
// this will create the unique chat between logged user, "userB" and "userC"KaleyraVideo.conversation.chat(currentActivity, userIds =listOf("userB", "userC")):Result<ChatUI>
// this will always create a new group chat between logged user, "userB" and "userC" with the // group chat friendly name set as "soccer team!"KaleyraVideo.conversation.chat(currentActivity, userIds =listOf("userB", "userC"), friendlyName ="soccer team!"):Result<ChatUI>
var chatIntent =BandyerIntent.Builder().startWithChat(currentActivity).with("userB").build()
startActivity(chatIntent)
Advanced
Call UI tools/actions
SDK actions definition has been strongly simplified
val chatObserver =object:ChatObserver {}
BandyerSDK.getInstance().chatModule?.addChatObserver(chatObserver)
Module Observer
v4
v3
// for the callBandyerSDK.conference.state.onEach { println("conferenceState=$it") }.launchIn(MainScope())
// for the chatBandyerSDK.conversation.state.onEach { println("conversationState=$it") }.launchIn(MainScope())
Please add and implement abstract class KaleyraVideoInitializer in order to handle edge cases when the connection token expires and the application has been killed from the user or from the system.
Add the following metadata to the AndroidManifest.xml inside the application tag. The metadata is needed in order to instantiate your KaleyraVideoInitializer class from within the SDK.
<!-- app manifest -->
<application>
[...]
<meta-data
android:name="kaleyra_video_initializer"
android:value="com.example.app.AppKaleyraVideoInitializer" /> <!-- path to your KaleyraVideInitializer implementation -->
</application>
Since every client had to provide a Theme implementation in order to customize the client call and chat UIs, has now been integrated a new convenient and centralized way to achieve the same result.
val brandColorSeed =ColorResource(Color(0xFF2A638A).toArgb())
val brandLogoUri = getYourBrandLogoUri()
KaleyraVideo.theme =Theme(
logo =Theme.Logo(URIResource(brandLogoUri, brandLogoUri)),
palette =Theme.Palette(seed = brandColorSeed),
typography =Theme.Typography(fontFamily =KaleyraFontFamily.default),
config =Theme.Config(style =Theme.Config.Style.System) // or force light mode with Theme.Config.Style.Light and dark with Theme.Config.Style.Dark
)