Reviews
Suggest to the player to leave a review for the game.
Request Review
FREE- JavaScript
- Unity
gp.app.requestReview();
GP_App.ReviewRequest();
The method returns the success of the operation and the rating, see response fields.
- JavaScript
- Unity
const result = await gp.app.requestReview();
const { success, rating, error } = result;
if (success) {
// example of working with rating
switch (rating) {
case 5:
showWindow('We are very glad you enjoyed the game!');
break;
case 4:
case 3:
// including when the rating cannot be determined
case 0:
showWindow('Thank you for your review!');
break;
case 2:
case 1:
showWindow('We will strive to do better!');
}
}
public void ReviewRequest()
{
GP_App.ReviewRequest(OnReviewResult, OnReviewClose);
Debug.Log("Send review request");
}
//On success review
private void OnReviewResult(int result)
{
Debug.Log("Review result: " + result);
}
//On review close
private void OnReviewClose(string error)
{
Debug.Log("Review result: " + error);
}
Supported platforms
Platforms without support
Check support
FREE- JavaScript
- Unity
gp.app.canRequestReview; // true / false
// true / false
bool result = GP_App.CanReview();
Use this property to check the support for adding a review on the current platform. It also checks the ability to add a review again.
- JavaScript
- Unity
if (gp.app.canRequestReview) {
// can request a review
}
if (GP_App.CanReview()) {
// can request a review
}
Check if a review has already been left
FREE- JavaScript
- Unity
gp.app.isAlreadyReviewed; // true / false
// true / false
GP_App.IsAlreadyReviewed();
Use this property to check if a review has already been left.
- JavaScript
- Unity
if (gp.app.isAlreadyReviewed) {
// review has already been left
}
if (GP_App.IsAlreadyReviewed())) {
// review has already been left
}
On some platforms, it is possible to change the rating. To check this, use the following combination:
- JavaScript
- Unity
if (gp.app.isAlreadyReviewed && gp.app.canRequestReview) {
// review has been left, but it can be changed
}
Not implemented
Response fields
Field | Type | Description | Example |
---|---|---|---|
success | boolean | Whether the player has rated the game | true |
rating | number | The player's rating. 0 - not supported | 5 |
error | string | Error code | unsupported |
Error codes
Error | Error description |
---|---|
unsupported | The method is not supported on the platform |
not_allowed | The method cannot be called (for example, the player is not authorized) |
already_rated | The review has already been submitted, resubmission is not available |
cancelled | The review window was closed |
others | Any unexpected errors (check the console) |
Stay in Touch
Other documents of this chapter available Here. To get started, welcome to the Tutorials chapter.
GamePush Community Telegram
: @gs_community.
For your suggestions e-mail
: [email protected]
We Wish you Success!