I am building an Android app using Azure communication service SDK. I can make a call, receive a call, everything seems to work fine except one thing: the status of my user is always offline. Is there a way to set the status of the user to online/away/... using the communication service SDK?
Just to be clear: I am not trying to retrieve the status of a user, but to set it up. Right now my user is considered "online" but appears "offline" on the Teams app.
At that point, even if there's an endpoint to query via an API to set it up I'd be okay with that, any solution would work.
Note that: Azure Communication Services (ACS) does not provide a direct API or SDK feature to set the presence status (online, away, etc.) of a user. Check this SO Thread by rocky and MsDoc
Hence, alternatively you can make use of Microsoft Graph API like below:
Presence.ReadWrite
or Presence.ReadWrite.All
API permission.To get the user's presence status, use the below query:
GET https://graph.microsoft.com/v1.0/users/UserID/presence
To set the user's presence status, use the below query:
POST https://graph.microsoft.com/v1.0/users/UserID/presence/setPresence
{
"sessionId": "The ID of the application's presence session",
"availability": "Available",
"activity": "Available",
"expirationDuration": "PT1H"
}
The user's presence status is set to available:
You can refer this blog and integrate with Azure Event Grid by Manish Saluja.
Reference: