Game rating
You can ask the user to rate the game and write a comment in a pop-up window. It appears when you request a rating.
Before requesting a game rating, make sure that the option is available for this user: they must be logged in and have not rated the game before.
For more information about working with ratings, see the Reviews page.
Checking whether requesting a rating is available
To find out if you can request a game rating, use the ysdk.feedback.canReview() method.
It returns a Promise<Object> that changes its state to resolved. The returned object contains the value key set to true/false, which you can use to see whether a rating request is possible:
|
Value |
Description |
|
|
You can request a rating. |
|
|
You cannot request a rating. The reason for rejection is returned as a string in the
|
Rating request
Alert
You can only request a game rating once per session. Be sure to use the ysdk.feedback.canReview() method before executing the request.
To ask the user to rate the game and write a comment, use the ysdk.feedback.requestReview() method.
It returns a Promise<Object> that changes its state to resolved. The returned object contains the feedbackSent key set to true/false. You can determine the user's action from it:
|
Value |
Description |
|
|
The user rated the game. |
|
|
The user closed the pop-up window. |
If you did not use the ysdk.feedback.canReview() method before executing the request, the value feedbackSent: false may be accompanied by the use canReview before requestReview error.
Example
1const ysdk = await YaGames.init();
2
3const { value, reason } = await ysdk.feedback.canReview();
4
5if (value) {
6 const { sentFeedback } = ysdk.feedback.requestReview();
7} else {
8 console.log(reason);
9}
Note
Our support team can help publish finished games on Yandex Games. If you have any questions about development or testing, ask them in the Discord channel.
If you are facing an issue or have a question regarding the use of Yandex Games SDK, please contact support: