The procedure is as follows.
・ Install and use the library -Dialog display timing configuration
** 1. Add to dependencies **
implementation 'com.vorlonsoft:androidrate:1.2.5-SNAPSHOT'
** 2. Gradle Sync to put the library **
** 1. Import with the class you want to display **
import com.vorlonsoft.android.rate.*
** 2. Create a review dialog **
AppRate.with(this)
** 3. Configure the dialog exit timing **
With the settings below, this is the condition.
After installing the app, start it 5 times and a dialog will appear after 20 days. After pressing the "again" button, it will start up 5 times and a dialog will appear after 20 days. No dialog appears after pressing "Do not review" or "Review".
.setStoreType(StoreType.GOOGLEPLAY)
.setTimeToWait(Time.DAY, 10)
.setLaunchTimes(3)
.setRemindTimeToWait(Time.DAY,20)
.setRemindLaunchesNumber(5)
.setSelectedAppLaunches(1)
.setShowLaterButton(true)
.setVersionCodeCheck(false)
.setVersionNameCheck(false)
.setDebug(false)
.setCancelable(false)
.setTitle(R.string.new_rate_dialog_title)
.setTextLater(R.string.new_rate_dialog_later)
.setMessage(R.string.new_rate_dialog_message)
.setTextNever(R.string.new_rate_dialog_never)
.setTextRateNow(R.string.new_rate_dialog_ok)
.monitor()
** 4. Added dialog button click event **
AppRate.with(this).setOnClickButtonListener(object: OnClickButtonListener {
override fun onClickButton(which:Byte) {
if(which.toString().equals(RATE)) {
//inApp_to review
} else if(which.toString().equals(RATE_LATER)) {
} else if(which.toString().equals(RATE_NEVER)) {
//nApp_Do not review
}
}
})
** 5. To display when matching with the configured settings **
if (AppRate.with(this).getStoreType() == StoreType.GOOGLEPLAY) { // Checks that current app store type from library options is StoreType.GOOGLEPLAY
if (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(this) != ConnectionResult.SERVICE_MISSING) { // Checks that Google Play is available
AppRate.showRateDialogIfMeetsConditions(this) // Shows the Rate Dialog when conditions are met
}
} else {
AppRate.showRateDialogIfMeetsConditions(this) // Shows the Rate Dialog when conditions are met
}
Recommended Posts