How to implement Rate It feature in Android App

前端 未结 14 1360
囚心锁ツ
囚心锁ツ 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 05:08

    Android’s new In-App Review system launched which lets developers ask for Play store reviews without leaving the app.

    To check design guidelines and when to display a review card, refer to the official document

    https://developer.android.com/guide/playcore/in-app-review

    To implement:

    • Add play-core library as a dependency in your build.gradle file.
    implementation 'com.google.android.play:core:1.8.0'
    
    • Create a ReviewManager instance and request ReviewInfo object. The ReviewInfo object to be pre-cached and then can trigger "launchReviewFlow" to present the Review card to the user.

       private var reviewInfo: ReviewInfo? = null
      
       val manager = ReviewManagerFactory.create(context)
      
       val request = manager.requestReviewFlow()
      
       requestFlow.addOnCompleteListener { request ->
           if (request.isSuccessful) {
               //Received ReviewInfo object
               reviewInfo = request.result
           } else {
               //Problem in receiving object
               reviewInfo = null
           }
      
       reviewInfo?.let {
           val flow = reviewManager.launchReviewFlow(this@MainActivity, it)
           flow.addOnCompleteListener {
               //Irrespective of the result, the app flow should continue
           }
       }
      

    Note : It is suggested to show the review flow after the user has experienced enough of your app or game.

    When to request an in-app review:

    • Trigger the in-app review flow after a user has experienced enough of your app or game to provide useful feedback.
    • Do not prompt the user excessively for a review. This approach helps minimize user frustration and limit API usage (see the section on quotas).
    • Your app should not ask the user any questions before or while presenting the rating button or card, including questions about their opinion (such as “Do you like the app?”) or predictive questions (such as “Would you rate this app 5 stars”).

    Few points before testing this:

    • While testing new functionalities, mostly we create a new project that would have new ApplicationId, make sure you give an ApplicationId that is already released and available in the play store.

    • If you have given feedback in the past for your app, in-app review API’s launchReviewFlow will not present any Review card. It simply triggers a success event.

    • Due to quota limitations, calling a launchReviewFlow method might not always display a dialog. It should not be linked with any click event.

    0 讨论(0)
  • 2020-12-02 05:08

    All those libraries are not the solution for the problem in this post. This libraries just open a webpage to the app on google play. Instead this Play core library has more consistent interface.

    So I think this is the problem, ProGuard: it obfscates some classes enough https://stackoverflow.com/a/63650212/10117882

    0 讨论(0)
提交回复
热议问题