Azure / communication-ui-library-android

Azure Communication UI Mobile Library for Android
https://learn.microsoft.com/en-us/azure/communication-services/concepts/ui-library/ui-library-overview?pivots=platform-web
MIT License
24 stars 29 forks source link

["1.10.0"] Getting callJoinFailed with Getting-Started Code #1087

Open TIMBLOCKER opened 1 month ago

TIMBLOCKER commented 1 month ago

Describe the bug We wanted to get started with the Android-Teams implementation and tried to insert the getting started code into a blank android app. Unfortunately we got the error callJoinFailed without any more information. The app showed us the join screen an then closed the screen after trying to connect to the meeting. We were able to reproduce the error on multiple devices with multiple meetings and tokens. We hope you can help us getting things sorted out.

To Reproduce Steps to reproduce the behavior: Use the following code in the MainActivity:

import android.os.Bundle;
import android.util.Log;
import android.widget.Button;
import com.azure.android.communication.common.CommunicationTokenCredential;
import com.azure.android.communication.common.CommunicationTokenRefreshOptions;
import com.azure.android.communication.ui.calling.CallComposite;
import com.azure.android.communication.ui.calling.CallCompositeBuilder;
import com.azure.android.communication.ui.calling.models.CallCompositeJoinLocator;
import com.azure.android.communication.ui.calling.models.CallCompositeLocalOptions;
import com.azure.android.communication.ui.calling.models.CallCompositeTeamsMeetingIdLocator;
import com.azure.android.communication.ui.calling.models.CallCompositeTeamsMeetingLinkLocator;

public class MainActivity extends AppCompatActivity {

 @Override
    protected void onCreate(Bundle savedInstanceState) {
        uper.onCreate(savedInstanceState);
       setContentView(R.layout.activity_main);

        Button startButton = findViewById(R.id.startButton);

        startButton.setOnClickListener(l -> {
            startCallComposite();
        });
    }

    private void startCallComposite() {
        CommunicationTokenRefreshOptions communicationTokenRefreshOptions =
                new CommunicationTokenRefreshOptions(() -> fetchToken(), true);

        CommunicationTokenCredential communicationTokenCredential =
                new CommunicationTokenCredential(communicationTokenRefreshOptions);

        CallCompositeJoinLocator locator = new CallCompositeTeamsMeetingIdLocator("941 720 796 228 1", "drjeh2");

        //Just to show that it didn't work without the Join-Screen either
        final CallCompositeLocalOptions localOptions = new CallCompositeLocalOptions()
                .setMicrophoneOn(true)
                .setCameraOn(true)
                .setSkipSetupScreen(true); //enable startup screen by setting this to true

        CallComposite callComposite = new CallCompositeBuilder()
                .applicationContext(this.getApplicationContext())
                .credential(communicationTokenCredential)
                .displayName("DISPLAY_NAME").build();

        callComposite.addOnErrorEventHandler(callCompositeErrorEvent -> {
            Log.e("TEAMSLIB", "ERROR: "+ callCompositeErrorEvent.getErrorCode());
        });

        callComposite.launch(this, locator, localOptions);
    }

    private String fetchToken() {
        return "TOKEN";
    }
}

Expected behavior When entering the meeting we want to be able to connect and normally talk with the meeting particitpants. Sadly we are not even able to join due to the error.

Screenshots Error Message: image Screenshot of Error Message if Setup Screen is enabled: Screenshot_20240919_120916_TeamsTester

AzureCommunicationUILibrary (please complete the following information):

Smartphone (please complete the following information):

Call Logs All logs we got were the message "callJoinFailed" when enabling the error listener.

Additional context We really did try to follow the steps of the library getting started page. It seems like we did excactly the same as in the documentation but still got the error. I hope you can support us in implementing the feature and getting rid of the aforementioned error.

pavelprystinka commented 1 month ago

Hi @TIMBLOCKER,

Thank you for such detailed descriptions. I have tested your code by just copy/past it and putting my token and it works fine for me. Could you please make sure you have a valid token.

Thank you.

TIMBLOCKER commented 1 month ago

Hi @pavelprystinka, thank you for your quick reply. To circumvent any problems with the token I creatd a new Azure Account and tried to create a new "Communication Service" instance just like it is described here and created a new access token like here.

In the end I got an instance of the service with the following properties:

image

After that I added a token for the instance:

image and added the token in the "TOKEN" field in the code.

Do I miss something here? I can not imagine any circumstance that it should not work with my token, but work fine with yours? Is there any possibilty that the token process and the service should not work with an Azure Student licence?

Thanks for helping!

pavelprystinka commented 1 month ago

Hi @TIMBLOCKER To help the ACS teams better support your integration needs and expectations, please fill out this form: Feedback Form

Thank you.

TIMBLOCKER commented 1 month ago

Hi @pavelprystinka,

thanks for the quick reply. I contacted the team so that we can (hopefully) figure things out. If there is any solution to the problem, I will get back to this issue to be documented for further reading.

image

Have a great week.