-2

I have to show the rating popup in app on 3 minutes of an application it may be on any screen.

I started the timer in SessionManager and sent callback to activities

public void startTimer(Context context) {
        handler.postDelayed(() -> {
            Intent intent = new Intent("SHOW_RATING_POPUP");
            context.sendBroadcast(intent);
        }, 180000);
    }

Broadcast listener of rating popup as below:

private void ratingListener() {
        IntentFilter intentFilter = new IntentFilter("SHOW_RATING_POPUP");
        broadcastReceiverTab = new BroadcastReceiver() {
            @Override
            public void onReceive(Context context, Intent intent) {
                showRateApp(context);
            }
        };
        context.registerReceiver(broadcastReceiverTab, intentFilter);
    }

I received dialog once but not able to get dialog on some android devices like realme and Moto. There are some quotas mentioned on Google docs but I wonder how can I solve this.

Kalpana Aneyrao
  • 100
  • 1
  • 11
  • You can not manipulate the quota and the nature of API . Since you need to track the time globally better do it in Application class . As mention [here](https://developer.android.com/guide/playcore/in-app-review#quotas) u can not call review API in short period of time more than once. And it says `for example, less than a month` . So your 3 min theory seems impossible . – ADM Nov 01 '21 at 06:03
  • Yes I am tracking time globally only and I got popup as well but in some devices unable to get popup. It should come atleast once per user – Kalpana Aneyrao Nov 01 '21 at 06:07
  • Check [This Thread](https://stackoverflow.com/questions/63286540/play-core-in-app-review-api-not-showing-the-review-activity) once . most of the error cases are covered there . Try every answer . – ADM Nov 01 '21 at 06:09

1 Answers1

0

you can just add the handler code after you show your showRateApp(context) so that it again gets registered to show after next 3 min:

private void ratingListener() {
     IntentFilter intentFilter = new IntentFilter("SHOW_RATING_POPUP");
     broadcastReceiverTab = new BroadcastReceiver() {
         @Override
         public void onReceive(Context context, Intent intent) {
             showRateApp(context);
             handler.postDelayed(() -> {
               Intent intent = new Intent("SHOW_RATING_POPUP");
               context.sendBroadcast(intent);
             }, 180000);
         }
     };
     context.registerReceiver(broadcastReceiverTab, intentFilter);
 }

Once you show your rateapp dialog the handler will again register and show next rate app dialog after 3 minutes.

unownsp
  • 727
  • 5
  • 19