Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Rate this app" dialog not showing on android #86

Open
josephfeleke opened this issue Nov 12, 2020 · 3 comments
Open

"Rate this app" dialog not showing on android #86

josephfeleke opened this issue Nov 12, 2020 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@josephfeleke
Copy link

josephfeleke commented Nov 12, 2020

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

@josephfeleke josephfeleke added the bug Something isn't working label Nov 12, 2020
@dewadhitya
Copy link

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

@josephfeleke
Copy link
Author

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.

@Skyost
Copy link
Owner

Skyost commented Dec 11, 2020

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants