0

I'm coming across an error in the quickstart library of the communications Ui.

In the startCallComposite

private fun startCallComposite() {
    val communicationTokenRefreshOptions = CommunicationTokenRefreshOptions({ fetchToken() }, true)
    val communicationTokenCredential = CommunicationTokenCredential(communicationTokenRefreshOptions)
//        val options = GroupCallOptions(
//            this,
//            communicationTokenCredential,
//            UUID.fromString("GROUP_CALL_ID"),
//            "DISPLAY_NAME",
//        )
    val options = TeamsMeetingOptions(
        this,
        communicationTokenCredential,
        "Meeting link",
        "Android Wayne",
    )
    val callComposite: CallComposite = CallCompositeBuilder().build()
    callComposite.setOnErrorHandler { Log.e("setOnErrorHandler", it.errorCode.toString()) }
    callComposite.launch(options)
}

I added an errorhandler to find what happened but there doesn't seem to be a cause that returns. Only an error code which is.

2022-01-20 11:13:26.758 15127-15127/com.example.uilibraryquickstart E/setOnErrorHandler: callJoin

I can't find any information on this error. Is there something I need to additionally add?

2 Answers2

0

This usually happens if the connections gets failed. And looks like you are using kotlin to achieve this.

To rectify this make sure you initialize communication token credentials, below is the usual way we do:

val callComposite: CallComposite = CallCompositeBuilder().build()    
val communicationTokenRefreshOptions = CommunicationTokenRefreshOptions(this::fetchToken, true)    
val communicationTokenCredential = CommunicationTokenCredential(communicationTokenRefreshOptions)

Also try to define group call ID for your call with UUID,

Below are few things that needs to be checked in:

  1. Check the required packages and install them.
  2. Try to properly initialize composite according to the steps mentioned in MS Azure Docs.
  3. Make sure you add all the device permissions.
SaiKarri-MT
  • 1,174
  • 1
  • 3
  • 8
0

I was using the wrong type of token. I needed the access token for the user but I was using my personal access token. The one used to create the others.

  • Hi Wayne, could you describe please what kind of token We have to use? We are having the same issue with handling the notifications – Paolo Mazza Dec 01 '22 at 10:40
  • Sorry this is so late and I also don't work at that particular place anymore. From what I remember, it was from a createUserandToken call and they expired. I don't remember at the time it being able to do it in java but it may have been update since. Here is a link. [link] (https://learn.microsoft.com/en-us/azure/communication-services/quickstarts/identity/access-tokens?tabs=windows&pivots=programming-language-java#create-an-identity-and-issue-a-token-in-one-request) – Wayne Kellman Apr 06 '23 at 01:31