Introduction

When a call or live broadcast ends, you can get feedback on the quality of experience to improve your product by asking your users to rate the call or live broadcast.

The Agora SDK provides methods for you to collect your users' ratings and comments on the calls.

After the rating function is implemented, you can see your users' ratings in Agora Analytics, as shown in the figure below:

Implementation

Before proceeding, ensure that you have prepared the development environment. See Integrate the SDK for more information.

agora::util::AString callId;
CString strCallId
lpAgoraEngine->getCallId(callId);

#ifdef UNICODE
 ::MultiByteToWideChar(CP_UTF8, 0, callId->c_str(), -1, strCallId.GetBuffer(128), 128);
 strCallId.ReleaseBuffer();
#else
 strCallId= callId->c_str();
#endif

#ifdef UNICODE
 CHAR wdCallId[MAX_PATH];

 ::WideCharToMultiByte(CP_UTF8, 0, strCallId, -1, wdCallId, MAX_PATH, NULL, NULL);
 lpAgoraEngine->rate(wdCallId, 5, "This is an awesome call!");
#else
 lpAgoraEngine->rate(strCallId, 5, "This is an awesome call!");
#endif

API Reference

Considerations

The API methods have return values. If the method fails, the return value is < 0.