Method signature
Method allows a game to suggest user to rate it:
FAPI.UI.showRatingDialog()
Usage example
function showRatingDialog() {
FAPI.UI.showRatingDialog()
}
Ratings API
In addition to this SDK method OK API allows you to get information about app’s ratings using following methods:
- apps.getAppUserRating - get current user’s rating for your game;
- apps.getAppRating - get game’s overall rating and amount of user’s who rated a game.
Callback examples
After a method is called user will be suggested to rate a game. Depending on his action on of following callbacks can be returned
Callback if user rated a game
method: “showRatingDialog”
result: “ok”
data: “5”
Callback if user declined to rate a game
method: “showRatingDialog”
result: “error”
data: “dismissed without rating”
Callback if dialog is already active
method: “showRatingDialog”
result: “error”
data: “layer already exists”
Callback if a feature is not supported for current device
method: “showRatingDialog”
result: “error”
data: “not_supported”
Webhook events
To monitor new player reviews you can subscribe to webhook.
When a new review was added to your game a following message will be sent to your webhook:
{
"prevComment": "",
"webhookType": "APP",
"prevRating": 0,
"appId": "app:123123123",
"type": "RATING_COMMENT",
"timestamp": 1691947736017,
"rating": 5,
"userName": "First Name Last Name",
"comment": "Game is good",
"userId": "user:123123123"
}
These messages will be sent when a review was added or edited by a user.