Skip to content

Handle Links

kristiyan-petrov edited this page May 3, 2024 · 7 revisions

Create links

The links need to be created via REST-API as described here this will give you an url for each participant that can be used at anytime to join the room.

Prerequisites

KaleyraVideoSDK needs to be configured before handling the link.

There are two different use-cases

  • Contact User (an user that can use the KaleyraVideoSDK outside of the call scope)
  • Lead/Prospect (an user that needs to access only the call feature and nothing else)

Lead/Prospect

A session will be created using the url link as access link will last only for the duration of the joined call.

All the sdk feature will be restricted on the call represented by the call link url.

In addition the only chat accessibile will be the chat related to the current call specified by the call link url.

Remember to configure the KaleyraVideoSDK as described here.

To connect via a call url please refer to the following code:

val configuration = Configuration(
	"appId",
	Environment.Sandbox,
	Region.Europe // your registration region
)
KaleyraVideo.configure(configuration)
val deferredUser: Deferred<User> = KaleyraVideo.connect("https://link")

At the end of the call the KaleyraVideoSDK will be automatically disconnected and all persisted data will be cleared as well.

Note that if KaleyraVideoSDK is already connected via access token, connecting via access link with the same user or with another user is not allowed. The current access link session must be ended before connecting again.

Contact User

To handle the url the KaleyraVideo must be initialized and connected! Once you have the preconditions you may connect the KaleyraVideo and then call the joinUrl api.

val configuration = Configuration(
	"appId",
	Environment.Sandbox,
	Region.Europe // your registration region
)

KaleyraVideo.configure(configuration)

// connect to the services 
KaleyraVideo.connect("userId", accessTokenProvider = { requestDate: Date ->
             Result.success("token")
})
// now join the call
val call: Result<CallUI> = KaleyraVideo.conference.joinUrl("https://link")

Configure App to open supported links

Add the following code in the AndroidManifest.xml under the activity that you want to be able to open the link with the app. You will be able to get the link from the intent during onCreate or newIntent of the activity. See our demo_app example or refer to android official guide for a more details on how to listen and handle an external link.

 <intent-filter android:autoVerify="true" tools:targetApi="m">
         <action android:name="android.intent.action.VIEW" />
         <category android:name="android.intent.category.DEFAULT" />
         <category android:name="android.intent.category.BROWSABLE" />

          	    <data
                    android:host="*.bandyer.com"
                    android:pathPattern="/..*/rest-call-handler/..*"
                    android:scheme="https" />
                <data
                    android:host="*.bandyer.com"
                    android:pathPattern="/..*/direct-rest-call-handler/..*"
                    android:scheme="https" />
</intent-filter>
Clone this wiki locally