[Android] Review dialog display

Review dialog display

The procedure is as follows.

・ Install and use the library -Dialog display timing configuration

Library introduction

** 1. Add to dependencies **


implementation 'com.vorlonsoft:androidrate:1.2.5-SNAPSHOT'
sshot_1.png

** 2. Gradle Sync to put the library ** sshot_2.png

Use the library

** 1. Import with the class you want to display **


import com.vorlonsoft.android.rate.*
sshot_3.png

** 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() 
sshot_4.png

** 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
                }
            }
        })
sshot_5.png

** 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
        }
sshot_6.png

Recommended Posts

[Android] Review dialog display
Android Development-Try to display a dialog-
[Android] Display Snackbar from any position
[Android] How to make Dialog Fragment
[Android 9.0 Pie Java] Implement horizontal swipe → dialog display → delete in chat application
Sample to display (head-up) notifications on Android
[Android / Java] Switch events by display Fragment
Display message dialog in java (personal memo)