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

value: true

You can request a rating.

value: false

You cannot request a rating.

The reason for rejection is returned as a string in the reason key:

  • NO_AUTH: The user is not logged in.
  • GAME_RATED: The user has already rated the game.
  • REVIEW_ALREADY_REQUESTED: The request has already been sent, awaiting the user's action.
  • REVIEW_WAS_REQUESTED: The request has already been sent, the user has taken action by either rating your game or closing the pop-up window.
  • UNKNOWN: The request was not sent, an error occurred on the Yandex side.

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

feedbackSent: true

The user rated the game.

feedbackSent: false

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:

Write to chat