Request App Review Functions
The Request App Review API uses the kony.application Namespace, are as follows.

This API retrieves the information required to launch the in-app review flow for an app. You must invoke this API before you invoke the kony.application.requestReview(config) API.
Before you raise a request for an in-app review, Android recommends that you cache the review object in advance. This is to ensure that the review information is successfully retrieved before the user navigates to a different screen. In addition, you can find the staleness of a cached object from the value of the timeElapsed parameter.
- Support for the kony.application.requestReviewFlow API is available from the Quantum Visualizer V9 Service Pack 2 release.
- Ensure that you add the
supportGooglePlayCoreLib=true
entry in the androidbuild.properties file of the project. - In-app reviews only work on devices that have the Google Play store installed, and use Chrome OS or Android versions 5.0 (API level 21), and later
Syntax
kony.application.requestReviewFlow(config);
Input Parameters
config - A JSON Object that contains the following keys:
Key | Description |
---|---|
clearCachedRequest[Boolean] |
Set the value of this key to true to request a new review info object (that is stored internally). When you set the value of this key to false, the API returns the review info object that was cached previously. If a cached review info object is not present, the API requests a new review info object from the native API The default value of this key is false. |
onResult [Function] |
A function callback that receives the status of the review flow. The callback function receives a JSON Object with the following keys:
|
Example
requestReviewFlow: function() {
var config = {
"clearCachedRequest": false,
"onResult":this.requestReviewFlowCallback
}
kony.application.requestReviewFlow(config);
},
requestReviewFlowCallback: function(info) {
if(info.statusCode == kony.application.REVIEW_FLOW_SUCCESS){
var timeElapsed = info.timeElapsed;
alert("StatusCode: "+ info.statusCode +
",timeElapsed: " + timeElapsed);
}else{
alert("StatusCode: "+ info.statusCode);
}
}
Return Values
None
Constant | Description |
---|---|
REVIEW_FLOW_SUCCESS | The requestReview flow is successful. |
REVIEW_FLOW_FAILED | The requestReview flow has failed. |
REVIEW_LIBRARY_MISSING | The required Google Play Core library is not linked with the application. |
GOOGLE_PLAY_SERVICES_UNAVAILABLE | The Google Play Store services are missing. |
GMS_LIBRARY_MISSING | The Google Mobile Services library is not linked with the application. |
Remarks
If the GMS or library is missing, the API returns the REVIEW_LIBRARY_MISSING, GMS_LIBRARY_MISSING, or GOOGLE_PLAY_SERVICES_UNAVAILABLE constants. Ideally, when you encounter these errors, you must not invoke the kony.application.requestReview(config) API.
Platform Availability
- Android

This function requests users to provide a rating and to write a review for an app.
Syntax
kony.application.requestReview(config);
Input Parameters
config [optional]- If you want to enable the in-app review feature on Android devices, you must include the config parameter, which is a JSON Object that contains the following keys:
Key | Description |
---|---|
reviewInApp [Boolean] |
Set the value of this key to true to indicate the use of the in-app review feature. Set the value of this key to false, to invoke the older review flow. The default value of this parameter is false. |
onResult [Function] |
A function callback that receives the status of creation of the review dialog. The callback function receives a JSON Object with the following keys:
|
NOTE: Support for the config parameter (that provides the in-app review functionality) is only available on the Android platform.
Example
requestReview: function() {
var config = {
"reviewInApp": true,
"onResult": this.requestReviewCallback
};
kony.application.requestReview(config);
},
requestReviewCallback: function(info) {
if(info.statusCode == kony.application.REVIEW_FAILED){
var timeElapsed = info.timeElapsed;
alert("StatusCode: "+ info.statusCode +
",timeElapsed: " + timeElapsed);
}else{
alert("StatusCode: "+ info.statusCode);
}
}
Return Values
None
Remarks
- If this API returns the REVIEW_SUCCESS status code constant, the review info object is cleared.
- If the GMS or library is missing, the API returns the REVIEW_LIBRARY_MISSING or GOOGLE_PLAY_SERVICES_UNAVAILABLE or GMS_LIBRARY_MISSING statusCode. However, in this case, the API reverts to invoking the older review flow.
Ideally, you must not invoke this API if you catch these errors in the kony.application.requestReviewFlow API.
Constant | Description |
---|---|
REVIEW_SUCCESS | The requestReview object successfully creates the in-app review popup. |
REVIEW_FAILED | The requestReview object fails to create the in-app review popup. |
REVIEW_FLOW_NOT_REQUESTED | The requestReview API is called without (or before) receiving the success status from the requestReviewFlow API or without invoking the requestReviewFlow API itself. |
REVIEW_LIBRARY_MISSING | The required Google Play Core library is not linked with the application. |
GOOGLE_PLAY_SERVICES_UNAVAILABLE | The Google Play Store services are missing. |
GMS_LIBRARY_MISSING | The Google Mobile Services library is not linked with the application. |
Platform Availability
- Android
- iOS
Status Codes
Constant | Description |
---|---|
REVIEW_FLOW_SUCCESS | The requestReview flow is successful. |
REVIEW_FLOW_FAILED | The requestReview flow has failed. |
REVIEW_SUCCESS | The requestReview object successfully creates the in-app review popup. |
REVIEW_FAILED | The requestReview object fails to create the in-app review popup. |
REVIEW_FLOW_NOT_REQUESTED | The requestReview API is called without (or before) receiving the success status from the requestReviewFlow API or without invoking the requestReviewFlow API itself. |
REVIEW_LIBRARY_MISSING | The required Google Play Core library is not linked with the application. |
GOOGLE_PLAY_SERVICES_UNAVAILABLE | The Google Play Store services are missing. |
GMS_LIBRARY_MISSING | The Google Mobile Services library is not linked with the application. |