Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Launch chat with user in MS Teams Android app from my android app

I have an Android app, where a tap on a button should launch Microsoft Teams Android app and open a chat with a pre-defined user.

Is it possible to do and if yes - how?

like image 685
displayname Avatar asked Sep 17 '25 06:09

displayname


1 Answers

If you know user's E-Mail with which he/she is registered in MS Teams (ex: [email protected]), you can directly open chat with him/her using one of two options:

  1. show user a chooser sheet with a choice to open chat in MS Teams Android app or one of web browsers:

    val sendIntent = Intent(Intent.ACTION_VIEW,
        Uri.parse("https://teams.microsoft.com/l/chat/0/[email protected]"))
    
    if (sendIntent.resolveActivity(packageManager) != null) {
        startActivity(sendIntent)
    }
    
  2. force open chat with user in MS Teams Android app. Same as above, but substitute in Uri https with msteams:

Uri.parse("msteams://teams.microsoft.com/l/chat/0/[email protected]")
like image 81
displayname Avatar answered Sep 18 '25 19:09

displayname