Skyost / RateMyApp

This plugin allows to kindly ask users to rate your app if custom conditions are met (eg. install time, number of launches, etc...).

Home Page:https://pub.dev/packages/rate_my_app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Rate this app" dialog not showing on android

josephfeleke opened this issue · comments

Describe the bug
I have implemented the code where it shows the simple dialog that asks the user if they want to rate the app, when i run the app on ios phone it shows the native rating dialog but whenever i run the app on android nothing comes up.

This is how i implemented the code, i commented out // if (rateMyApp.shouldOpenDialog) { just so the dialog would show at the start of the app

`class PSApp extends StatefulWidget {
 @override
_PSAppState createState() => _PSAppState();
}

class _PSAppState extends State<PSApp> {
 Completer<ThemeData> themeDataCompleter;
 PsSharedPreferences psSharedPreferences;

RateMyApp rateMyApp = RateMyApp(
  preferencesPrefix: 'rateMyApp_',
  minDays: 7,
  minLaunches: 10,
  remindDays: 7,
  remindLaunches: 10,
  googlePlayIdentifier: 'com.zaremart.zaremartapp',
  appStoreIdentifier: '1491556149',
);

@override
void initState() {
  super.initState();

  rateMyApp.init().then((_) {
   // if (rateMyApp.shouldOpenDialog) {
      rateMyApp.showRateDialog(
        context,
        title: 'Rate this app',
        // The dialog title.
        message: 'If you like this app, please take a little bit of your time to review it !\nIt really helps us and it shouldn\'t take you more than one minute.',
        // The dialog message.
        rateButton: 'RATE',
        // The dialog "rate" button text.
        noButton: 'NO THANKS',
        // The dialog "no" button text.
      laterButton: 'MAYBE LATER',
      // The dialog "later" button text.
      listener: (
          RateMyAppDialogButton button) { // The button click listener (useful if you want to cancel the click event).
        switch (button) {
          case RateMyAppDialogButton.rate:
            print('Clicked on "Rate".');
            break;
          case RateMyAppDialogButton.later:
            print('Clicked on "Later".');
            break;
          case RateMyAppDialogButton.no:
            print('Clicked on "No".');
            break;
        }

        return true; // Return false if you want to cancel the click event.
      },
      ignoreNativeDialog: false,
      // Set to false if you want to show the Apple's native app rating dialog on iOS or Google's native app rating dialog (depends on the current Platform).
      dialogStyle: DialogStyle(),
      // Custom dialog styles.
      onDismissed: () =>
          rateMyApp.callEvent(RateMyAppEventType
              .laterButtonPressed), // Called when the user dismissed the dialog (either by taping outside or by pressing the "back" button).
      // contentBuilder: (context, defaultContent) => content, // This one allows you to change the default dialog content.
      // actionsBuilder: (context) => [], // This one allows you to use your own buttons.
    );
 // }
});
  }`

Expected behavior
I was expecting to see the "Rate this app" dialog when my app runs and when user clicked the rate app button to open tha native in app rating dialog on android but the dialog that asks the user to rate my app is not showing.

This was what i wanted to see when my app runs:
photo_2020-11-12 23 53 45

Screenshots
This is what its showing on ios simulator
Screen Shot 2020-11-12 at 9 50 09 PM

And nothing is showing up on android
Screen Shot 2020-11-12 at 11 52 29 PM

Try use ignoreNativeDialog: Platform.isAndroid, instead of ignoreNativeDialog: false, .
It will follow the platform that you used.

Try use ignoreNativeDialog: Platform.isAndroid, instead of ignoreNativeDialog: false, .
It will follow the platform that you used.

Thank you for your replay, i was thinking that no one would replay to this issue and I completely gave up on this plugin.
Ok now let me try what you suggested and ill lett you know what i got.

@josephfeleke You should also put your code inside a PostFrameCallback :

@override
void initState() {
  super.initState();
  WidgetsBinding.instance.addPostFrameCallback((_) {
    // Show Rate My App here.
  });
}