3

I'm trying to utilize the Review API (Play Core library 1.8.0) from Google which was just released today. See https://developer.android.com/guide/playcore/in-app-review. I am currently using it using the following code:

public void inAppReview() {
        ReviewManager reviewManager = ReviewManagerFactory.create(getActivity());
        Task<ReviewInfo> request = reviewManager.requestReviewFlow();
        request.addOnCompleteListener(new OnCompleteListener<ReviewInfo>() {
            @Override
            public void onComplete(@NonNull Task<ReviewInfo> task) {    
                if (task.isSuccessful()) {
                    ReviewInfo reviewInfo = task.getResult();
                    
                    Task<Void> flow = reviewManager.launchReviewFlow(getActivity(), reviewInfo);
                    flow.addOnCompleteListener(new OnCompleteListener<Void>() {
                        @Override
                        public void onComplete(@NonNull Task<Void> task) {
                            Log.e("task<void>", task.isComplete() + "");
                            Log.e("task<void>", task.isSuccessful() + "");
                        }
                    }).addOnFailureListener(new com.google.android.play.core.tasks.OnFailureListener() {
                        @Override
                        public void onFailure(Exception e) {
                            
                        }
                    }); 
                } else {
                    Log.e("Review error", "Review error");
                }
            }
        }).addOnFailureListener(new com.google.android.play.core.tasks.OnFailureListener() {
            @Override
            public void onFailure(Exception e) { 
              Log.e("Review error", "Review error");
            }
        });
    }

I have tested using the Internal Test Track in the Google Play Developer Console, but unfortunately, I am not receiving the review dialog on my test account. What am I doing wrong?

Jason
  • 1,658
  • 3
  • 20
  • 51
my_box
  • 41
  • 1
  • 2
  • my_box your question is not clear ... Can you tell us what is the problem you are facing for more info please read [how-to-ask?](http://stackoverflow.com/help/how-to-ask). Include just enough code to allow others to reproduce the problem. For help with this, read [How to create a Minimal, Complete, and Verifiable example.](https://stackoverflow.com/help/mcve) I you are getting any errors please post the stacktrace also – AgentP Aug 21 '20 at 06:25
  • 1
    Do you find any solution ? I have the same issue too ! – EAK TEAM Aug 31 '20 at 22:23
  • @my_box, I have answered this problem here: https://stackoverflow.com/questions/63286540/play-core-in-app-review-api-not-showing-the-review-activity/65333746#65333746. It is simply a lack of detail in the documentation. You will get reliable and repeatable review dialog loads once you are set-up correctly. Your code is fine. – Kofi Dec 17 '20 at 03:22

1 Answers1

1

I am trying to investigate this too. Maybe proguard obfuscates some classes of Play Core. Try to keep all classes in Play core, Parcelable and Serializable However in the logcat there are errors

-keep class * implements com.google.android.play { *; }
-keep class com.google.android.play.** { *; }
-keep interface com.google.android.play.** { *; }

-keepclassmembers class * implements android.os.Parcelable {
    static *** CREATOR;
}

-keepclassmembers class * implements java.io.Serializable {
    static final long serialVersionUID;
    static final java.io.ObjectStreamField[] serialPersistentFields;
    private void writeObject(java.io.ObjectOutputStream);
    private void readObject(java.io.ObjectInputStream);
    java.lang.Object writeReplace();
    java.lang.Object readResolve();
}
Phantom Lord
  • 572
  • 3
  • 13
  • No, it is not about Proguard/R8, i have similar issue in debug too ! – EAK TEAM Aug 31 '20 at 22:23
  • After some day it worked. Only with published apps. The code is the same of my_box. But it ask a rating (in stars) and require a mndatort comment – Phantom Lord Sep 02 '20 at 05:17
  • @EAK TEAM maybe your debug configuration has ProGuard too – Phantom Lord Sep 04 '20 at 05:05
  • 4
    The last version of PlayCore library v1.8.3 includes the correct proguard configuration ``-keepnames class com.google.android.play.core.review.ReviewInfo`` – Marcel Oct 12 '20 at 05:27