How to implement Rate It feature in Android App

前端 未结 14 1387
囚心锁ツ
囚心锁ツ 2020-12-02 04:19

I am developing an Android App. In which everything is working right. My app is ready to launch. But there I need to implement one more feature. I need to display a popup wh

14条回答
  •  不知归路
    2020-12-02 04:55

    As of August 2020, Google Play's In-App Review API is available and its straightforward implementation is correct as per this answer.

    But if you wish add some display logic on top of it, use the Five-Star-Me library.

    Set launch times and install days in the onCreate method of the MainActivity to configure the library.

      FiveStarMe.with(this)
          .setInstallDays(0) // default 10, 0 means install day.
          .setLaunchTimes(3) // default 10
          .setDebug(false) // default false
          .monitor();
    

    Then place the below method call on any activity / fragment's onCreate / onViewCreated method to show the prompt whenever the conditions are met.

    FiveStarMe.showRateDialogIfMeetsConditions(this); //Where *this* is the current activity.
    

    Installation instructions:

    You can download from jitpack.

    Step 1: Add this to project (root) build.gradle.

    allprojects {
      repositories {
        ...
        maven { url 'https://jitpack.io' }
      }
    }
    

    Step 2: Add the following dependency to your module (app) level build.gradle.

    dependencies {
      implementation 'com.github.numerative:Five-Star-Me:2.0.0'
    }
    
    

提交回复
热议问题