This plugin allows to kindly ask users to rate your app if custom conditions are met

Overview

Rate my app !

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

Rate my app is really inspired by Android-Rate.

How to use

Installation

If you're building your app for Android, be sure that your app is upgraded to the Android Embedding V2 (if you've created your project with a Flutter version ≥ 1.12, you should be okay).

On iOS, if you want to target a version before 10.3, add this in your Info.plist :

<key>LSApplicationQueriesSchemeskey>
<array>
    <string>itmsstring>
array>

By the way, it's important to note that your bundle identifier (in your Info.plist) must match the App ID on iTunes Connect and the package identifier (in your build.gradle) must match your App ID on Google Play. Oh, and your project must use Swift.

If for any reason it doesn't match please go to the Using custom identifiers section.

How it works

Rate my app default constructor takes two main parameters (see Example for more info) :

  • minDays Minimum elapsed days since the first app launch.
  • minLaunches Minimum app launches count.

If everything above is verified, the method shouldOpenDialog will return true (false otherwise). Then you should call showRateDialog which is going to show a native rating dialog on iOS ≥ 10.3 and a custom rating prompt dialog on Android (and on older iOS versions).

If you prefer, you can call showStarRateDialog which will show a dialog containing a star rating bar that will allow you to take custom actions based on the rating (for example if the user puts less than 3 stars then open your app bugs report page or something like this and if he puts more ask him to rate your app on the store page). Still, you have to be careful with these practises (see this paragraph on App Radar).

Screenshots

On Android
showRateDialog method with ignoreNative set to true.
On iOS
showRateDialog and showStarRateDialog methods with ignoreNative set to false.

Using it in your code

Code snippets

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. ); // Or if you prefer to show a star rating bar (powered by `flutter_rating_bar`) : rateMyApp.showStarRateDialog( context, title: 'Rate this app', // The dialog title. message: 'You like this app ? Then take a little bit of your time to leave a rating :', // The dialog message. // contentBuilder: (context, defaultContent) => content, // This one allows you to change the default dialog content. actionsBuilder: (context, stars) { // Triggered when the user updates the star rating. return [ // Return a list of actions (that will be shown at the bottom of the dialog). FlatButton( child: Text('OK'), onPressed: () async { print('Thanks for the ' + (stars == null ? '0' : stars.round().toString()) + ' star(s) !'); // You can handle the result as you want (for instance if the user puts 1 star then open your contact page, if he puts more then open the store page, etc...). // This allows to mimic the behavior of the default "Rate" button. See "Advanced > Broadcasting events" for more information : await rateMyApp.callEvent(RateMyAppEventType.rateButtonPressed); Navigator.pop (context, RateMyAppDialogButton.rate); }, ), ]; }, ignoreNativeDialog: Platform.isAndroid, // 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: const DialogStyle( // Custom dialog styles. titleAlign: TextAlign.center, messageAlign: TextAlign.center, messagePadding: EdgeInsets.only(bottom: 20), ), starRatingOptions: const StarRatingOptions(), // Custom star bar rating options. onDismissed: () => rateMyApp.callEvent(RateMyAppEventType.laterButtonPressed), // Called when the user dismissed the dialog (either by taping outside or by pressing the "back" button). ); } });">
// In this snippet, I'm giving a value to all parameters.
// Please note that not all are required (those that are required are marked with the @required annotation).

RateMyApp rateMyApp = RateMyApp(
  preferencesPrefix: 'rateMyApp_',
  minDays: 7,
  minLaunches: 10,
  remindDays: 7,
  remindLaunches: 10,
  googlePlayIdentifier: 'fr.skyost.example',
  appStoreIdentifier: '1491556149',
);

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: (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: Platform.isAndroid, // 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: const 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. 
    );
    
    // Or if you prefer to show a star rating bar (powered by `flutter_rating_bar`) :
    
    rateMyApp.showStarRateDialog(
      context,
      title: 'Rate this app', // The dialog title.
      message: 'You like this app ? Then take a little bit of your time to leave a rating :', // The dialog message.
      // contentBuilder: (context, defaultContent) => content, // This one allows you to change the default dialog content.
      actionsBuilder: (context, stars) { // Triggered when the user updates the star rating.
        return [ // Return a list of actions (that will be shown at the bottom of the dialog).
          FlatButton(
            child: Text('OK'),
            onPressed: () async {
              print('Thanks for the ' + (stars == null ? '0' : stars.round().toString()) + ' star(s) !');
              // You can handle the result as you want (for instance if the user puts 1 star then open your contact page, if he puts more then open the store page, etc...).
              // This allows to mimic the behavior of the default "Rate" button. See "Advanced > Broadcasting events" for more information :
              await rateMyApp.callEvent(RateMyAppEventType.rateButtonPressed);
              Navigator.pop<RateMyAppDialogButton>(context, RateMyAppDialogButton.rate);
            },
          ),
        ];
      },
      ignoreNativeDialog: Platform.isAndroid, // 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: const DialogStyle( // Custom dialog styles.
        titleAlign: TextAlign.center,
        messageAlign: TextAlign.center,
        messagePadding: EdgeInsets.only(bottom: 20),
      ),
      starRatingOptions: const StarRatingOptions(), // Custom star bar rating options.
      onDismissed: () => rateMyApp.callEvent(RateMyAppEventType.laterButtonPressed), // Called when the user dismissed the dialog (either by taping outside or by pressing the "back" button).
    );
  }
});

Minimal Example

Below is the minimal code example. This will be for the basic minimal working of this plugin. The below will launch a simple message popup after the defined minimal days/minimal launches along with the default buttons : Rate, Maybe later and Cancel, with their default behavior.

Place this in your main widget state :

RateMyApp rateMyApp = RateMyApp(
  preferencesPrefix: 'rateMyApp_',
  minDays: 0, // Show rate popup on first day of install.
  minLaunches: 5, // Show rate popup after 5 launches of app after minDays is passed.
);

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

  WidgetsBinding.instance?.addPostFrameCallback((_) async {
    await rateMyApp.init();
    if (mounted && rateMyApp.shouldOpenDialog) {  
      rateMyApp.showRateDialog(context);
    }
  });
}

If you want a more complete example, please check this one on Github.
You can also follow the tutorial of Marcus Ng on YouTube (for a replacement of doNotOpenAgain, see Broadcasting events).

Advanced

Where to initialize Rate My App

You should be careful on where you initialize Rate My App in your project. But thankfully, there's a widget that helps you getting through all of this without any trouble : RateMyAppBuilder. Here's an example :

// The builder should be initialized exactly one time during the app lifecycle.
// So place it where you want but it should respect that condition.

RateMyAppBuilder(
  builder: (context) => MaterialApp(
    home: Scaffold(
      appBar: AppBar(
        title: const Text('Rate my app !'),
      ),
      body: Center(child: Text('This is my beautiful app !')),
    ),
  ),
  onInitialized: (context, rateMyApp) {
    // Called when Rate my app has been initialized.
    // See the example project on Github for more info.
  },
);

You can totally choose to not use it and to initialize Rate my app in your main() method. This is up to you !

Using custom identifiers

It's possible to use custom store identifiers ! Just pass the following parameters during the plugin initialization :

  • googlePlayIdentifier Your Google Play identifier (usually a package name).
  • appStoreIdentifier Your App Store identifier (usually numbers). It's required if you're targeting an iOS version before iOS 10.3.

Using custom conditions

A condition is something required to be met in order for the shouldOpenDialog method to return true. Rate my app comes with three default conditions :

  • MinimumDaysCondition Allows to set a minimum elapsed days since the first app launch before showing the dialog.
  • MinimumAppLaunchesCondition Allows to set a minimum app launches count since the first app launch before showing the dialog.
  • DoNotOpenAgainCondition Allows to prevent the dialog from being opened (when the user clicks on the No button for example).

You can easily create your custom conditions ! All you have to do is to extend the Condition class. There are five methods to override :

  • readFromPreferences You should read your condition values from the provided shared preferences here.
  • saveToPreferences You should save your condition values to the provided shared preferences here.
  • reset You should reset your condition values here.
  • isMet Whether this condition is met.
  • onEventOccurred When an event occurs in the plugin lifecycle. This is usually here that you can update your condition values. Please note that you're not obligated to override this one (although this is recommended).

You can have an easy example of it by checking the source code of DoNotOpenAgainCondition.

Then you can add your custom condition to Rate my app by using the constructor customConditions (or by calling rateMyApp.conditions.add before initialization).

Broadcasting events

As said in the previous section, the shouldOpenDialog method depends on conditions.

For example, when you click on the No button, this event will be triggered and the condition DoNotOpenAgainCondition will react to it and will stop being met and thus the shouldOpenDialog will return false.

You may want to broadcast events in order to mimic the behaviour of the No button for example. This can be done either by using the RateMyAppNoButton or you can directly call callEvent from your current RateMyApp instance in your button onTap callback.

Here are what events default conditions are listening to :

  • MinimumDaysCondition : Later button press.
  • MinimumAppLaunchesCondition : Rate my app initialization, Later button press.
  • DoNotOpenAgainCondition : Rate button press, No button press.

For example, starting from version 0.5.0, the getter/setter doNotOpenAgain has been removed. You must trigger the DoNotOpenAgainCondition either by calling a Rate button press event or a No button press event (see Example on Github).

Contributions

You have a lot of options to contribute to this project ! You can :

Dependencies

This library depends on some other libraries :

Comments
  • Unhandled Exception: PlatformException(activity_is_null, Activity is null., null)

    Unhandled Exception: PlatformException(activity_is_null, Activity is null., null)

    Describe the bug When the RateMyApp is called, the dialog is not prompted at all and I get the following error :

    E/flutter (30220): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: PlatformException(activity_is_null, Activity is null., null)
    E/flutter (30220): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:572:7)
    E/flutter (30220): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:161:18)
    E/flutter (30220): <asynchronous suspension>
    E/flutter (30220): #2      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:334:12)
    E/flutter (30220): #3      RateMyApp.isNativeReviewDialogSupported (package:rate_my_app/src/core.dart:96:62)
    E/flutter (30220): #4      RateMyApp.showStarRateDialog (package:rate_my_app/src/core.dart:157:38)
    

    PLEASE NOTE that this issue only occurs when ignoreNativeDialogis set to false. When this parameter is set to true, everything works as expected (with no change of the context).

    RateMyApp is called after main() initialization, way after the widgets are painted.

    Smartphone (please complete the following information):

    • Device: Galaxy A20e
    • OS: Android 9

    Additional context RateMyApp version used: 0.7.0 Flutter doctor output:

    Doctor summary (to see all details, run flutter doctor -v):
    [√] Flutter (Channel stable, 1.20.1, on Microsoft Windows [Version 10.0.18363.1016], locale fr-FR)
    [√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    [√] Android Studio (version 4.0)
    [√] Connected device (1 available)
    

    Thanks for the help

    bug 
    opened by aleaforny 29
  • Rate Dialog is not showing.

    Rate Dialog is not showing.

    Hi, Thanks for this wonderfull package. But I am unable to use it. I am writing following code but

    rateMyApp.shouldOpenDialog

    is always returning false.

    I am writing code in main.dart

    My code is:

    RateMyApp rateMyApp = RateMyApp(
        preferencesPrefix: 'rateMyApp_',
        minDays: 0,
        minLaunches: 0,
        remindDays: 7,
        remindLaunches: 10,
        googlePlayIdentifier: 'fr.skyost.example',
        appStoreIdentifier: '1491556149',
      );
    
      @override
      void initState() {
        super.initState();
        _model.getLoggedInStatus().then((value) {
          setState(() {
            userIsLoggedIn = value;
          });
        });
    
        rateMyApp.init().then((_) {
          if (rateMyApp.shouldOpenDialog) {
            print("Rate App");
            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: (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.
            );
    
            // Or if you prefer to show a star rating bar :
    
            rateMyApp.showStarRateDialog(
              context,
              title: 'Rate this app', // The dialog title.
              message:
                  'You like this app ? Then take a little bit of your time to leave a rating :', // The dialog message.
              // contentBuilder: (context, defaultContent) => content, // This one allows you to change the default dialog content.
              actionsBuilder: (context, stars) {
                // Triggered when the user updates the star rating.
                return [
                  // Return a list of actions (that will be shown at the bottom of the dialog).
                  FlatButton(
                    child: Text('OK'),
                    onPressed: () async {
                      print('Thanks for the ' +
                          (stars == null ? '0' : stars.round().toString()) +
                          ' star(s) !');
                      // You can handle the result as you want (for instance if the user puts 1 star then open your contact page, if he puts more then open the store page, etc...).
                      // This allows to mimic the behavior of the default "Rate" button. See "Advanced > Broadcasting events" for more information :
                      await rateMyApp
                          .callEvent(RateMyAppEventType.rateButtonPressed);
                      Navigator.pop<RateMyAppDialogButton>(
                          context, RateMyAppDialogButton.rate);
                    },
                  ),
                ];
              },
              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.
                titleAlign: TextAlign.center,
                messageAlign: TextAlign.center,
                messagePadding: EdgeInsets.only(bottom: 20),
              ),
              starRatingOptions:
                  StarRatingOptions(), // Custom star bar rating options.
              onDismissed: () => rateMyApp.callEvent(RateMyAppEventType
                  .laterButtonPressed), // Called when the user dismissed the dialog (either by taping outside or by pressing the "back" button).
            );
          }
        });
      }
    

    Thanks in advance.

    bug 
    opened by MuhammadAliKust 20
  • It is not opening App Store For IOS

    It is not opening App Store For IOS

    Describe the bug After executing the method Future launchStore() => RateMyApp._channel.invokeMethod('launchStore', { 'appId': storeIdentifier, });

    and having set properly appStoreIdentifier, app store is not opened to prompt for a review

    To Reproduce Steps to reproduce the behavior:

    Easy, just execute the following anywhere you want:

    RateMyApp _rateMyApp = RateMyApp(
      preferencesPrefix: 'rateMyApp_',
      minDays: 7,
      minLaunches: 10,
      remindDays: 7,
      remindLaunches: 10,
      appStoreIdentifier: 'putsomeappidhere',
    );
    
    _rateMyApp.launchStore();
    

    Expected behavior It is expected that user is redirected to app store and prompted to review that app, currently nothing happens!

    Screenshots If applicable, add screenshots to help explain your problem.

    Screenshot 2020-09-10 at 12 20 46

    I tried to debug your plugin RateMyAppPlugin.m, and I see that canOpenUrl returns always false, and then code to open store is not executed....

    bug 
    opened by FL-K 16
  • shouldOpenDialog is always false. Please help if there is something I am doing wrong.

    shouldOpenDialog is always false. Please help if there is something I am doing wrong.

    This is how I am using this plug-in in my flutter app.

    `class Home extends StatefulWidget{ HomeState createState() => HomeState(); }

    class HomeState extends State with TickerProviderStateMixin{

    RateMyApp _rateMyApp = RateMyApp( minDays: 1, minLaunches: 2, remindDays: 1, remindLaunches: 2, );

    void initState(){ rateMyApp.init().then(() { if (_rateMyApp.shouldOpenDialog) { _rateMyApp.showRateDialog( context, title: 'Rate this app', 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.', rateButton: 'RATE', noButton: 'NO THANKS', laterButton: 'MAYBE LATER', ); } }); }

    Widget build(BuildContext context){ }

    }`

    I have displayed the value of _rateMyApp.shouldOpenDialog in a text widget in my UI for testing, and it is always false, which should be true after 2 launches. Because it is always false, the rate-dialog is never appearing. Is there something I am doing wrong?

    bug question 
    opened by japatel225 13
  • Beginner question regarding rate_my_app plugin

    Beginner question regarding rate_my_app plugin

    Hi,

    I apologise in advance for the very beginner question but I am new to flutter and am having trouble trying to implement this plugin.

    The example code shown in the plugin is a bit complicated for me as it relies on an additional content.dart file which I tried to make sense of but failed.

    This implementation of rate_my_app makes sense to me and is very easy: https://github.com/MarcusNg/flutter_rating_prompt/blob/master/lib/main.dart but it looks like this is for an old version and it does not work with the latest version of the plugin.

    From the linked page above this is the part that is outdated:

    _rateMyApp.init().then((_) {
          // TODO: Comment out this if statement to test rating dialog (Remember to uncomment)
          // if (_rateMyApp.shouldOpenDialog) {
          _rateMyApp.showStarRateDialog(
            context,
            title: 'Enjoying Flutter Rating Prompt?',
            message: 'Please leave a rating!',
            onRatingChanged: (stars) {
              return [
                FlatButton(
                  child: Text('Ok'),
                  onPressed: () {
                    if (stars != null) {
                      _rateMyApp.doNotOpenAgain = true;
                      _rateMyApp.save().then((v) => Navigator.pop(context));
    
                      if (stars <= 3) {
                        print('Navigate to Contact Us Screen');
                        // Navigator.push(
                        //   context,
                        //   MaterialPageRoute(
                        //     builder: (_) => ContactUsScreen(),
                        //   ),
                        // );
                      } else if (stars <= 5) {
                        print('Leave a Review Dialog');
                        // showDialog(...);
                      }
                    } else {
                      Navigator.pop(context);
                    }
                  },
                ),
              ];
            },
            dialogStyle: DialogStyle(
              titleAlign: TextAlign.center,
              messageAlign: TextAlign.center,
              messagePadding: EdgeInsets.only(bottom: 20.0),
            ),
            starRatingOptions: StarRatingOptions(),
          );
          // }
        });
    

    The onRatingChanged parameter no longer exists, and I dont know how to replace it.

    I am simply wanting to use the plugin to show a popup, after say 5 app launches, if they want to leave a rating.. if yes, they should be directed to the play store link.

    That is all, I do not want to measure stars or do anything else.

    Can you please help me out here.

    Thank you

    question 
    opened by farazk86 11
  • [Question] showRateDialog on iOS, parameters not taken into account

    [Question] showRateDialog on iOS, parameters not taken into account

    Describe the bug If I use showRateDialog on iOS and try to fill parameters like title, message, listener It seems those parameters are not taken into account. By example listener is not fired

    To Reproduce Steps to reproduce the behavior:

    1. Start the RateDialog using the RateMyAppBuilder widget

    Expected behavior listener are fired to manage RateMyAppDialogButton.rate / RateMyAppDialogButton.later

    bug 
    opened by fvisticot 7
  • possibility to set the content of the dialog

    possibility to set the content of the dialog

    I'd like to have the possibility to replace title & message by whatever Widget of my choice

    Future showStarRateDialog( BuildContext context, { String title, String message,

    Thx.

    enhancement 
    opened by silversquall 7
  • hello sir , i tried to use this plugin , but its not opening the dialog after 3 days...

    hello sir , i tried to use this plugin , but its not opening the dialog after 3 days...

    hello sir , i tried to use this plugin , but its not opening the dialog after 3 days or the times I have specified the launches .. it works in production when the if (_rateMyApp.shouldOpenDialog) { line is uncomment , but its not working when i uncomment it .

    bug 
    opened by simra-aulakh 7
  • Possibility to further customize the dialog

    Possibility to further customize the dialog

    Hi, i was wondering if there is any change some changes could be made to the Dialog structure: The AlertDialog ButtonRow widget, is a row, which contains a padding, what is not exanded so it's always going to shrink around the action buttons, forcing them to align the right., would be nice to have the possibility to have some control over the buttons as well.

    Cheers!

    David

    enhancement 
    opened by davidBarbieri 7
  • After 7 days the app is installed i get the rating popup everytime

    After 7 days the app is installed i get the rating popup everytime

    After 7 days the app is installed i get the rating popup everytime i switch page/open the app

    This is my init Code

    RateMyApp(
            minDays: 7,
            minLaunches: 10,
            remindDays: 7,
            remindLaunches: 10, 
          ));
    

    This is the way i open the popup:

    _rateMyApp.init().then((_) {
          if (_rateMyApp.shouldOpenDialog) {
            _rateMyApp.showStarRateDialog(
              context,
              title: ToTLocalizations.of(context).rateAppTitle,
              message: ToTLocalizations.of(context).rateAppContent,
              ignoreIOS: false,
              starRatingOptions: StarRatingOptions(),
              onRatingChanged: (stars) {
                return [
                  RaisedButton(
                    padding: EdgeInsets.all(10.0),
    ...
    

    The expected behavior is that if i click "later" the "baseLaunchDate" should be set to today, and the popup opened again in 7 (remind days) days

    I'm running it on IOS 12.4 simulator

    The native popup is opened, but as far i can understand there is no management in the plugin for the native form callback up to the dart code and shared preferences.

    bug 
    opened by davidBarbieri 7
  • Android rating does not appear in google play

    Android rating does not appear in google play

    Describe the bug When rating in android using non-native dialog, the ratings does not get published/submitted in google play. I tired to set for android native dialog ignoreNativeDialog: Platform.isAndroid, but the native dialog did not appear on the app although the app is published in google play store.

    Note: no issues with IOS, native dialog appear and the rating is published and appears in the app store.

    This is my code:

    RateMyApp rateMyApp = RateMyApp(
        preferencesPrefix: 'rateMyApp_',
        minDays: 7,
        minLaunches: 10,
        remindDays: 7,
        remindLaunches: 10,
        googlePlayIdentifier: '**************',
        appStoreIdentifier: '***********',
      );
    
    void initState() {
        super.initState();
        fetchData();
        Future.delayed(const Duration(seconds: 1), () {
          _rateMyApp();
        });
      }
    
    void _rateMyApp() {
        rateMyApp.init().then((_) {
          if (rateMyApp.shouldOpenDialog) {
          rateMyApp.showStarRateDialog(
            context,
            title: 'Rate this App', // The dialog title.
            message:
                'Do you like this app? Please take sometime to rate it', // The dialog message.
            actionsBuilder: (context, stars) {
              return [
                FlatButton(
                  child: Text('Ok'),
                  onPressed: () async {
                    print('Thanks for the ' +
                        (stars == null ? '0' : stars.round().toString()) +
                        ' star(s) !');
                    await rateMyApp.callEvent(RateMyAppEventType.rateButtonPressed);
                    Navigator.pop<RateMyAppDialogButton>(
                        context, RateMyAppDialogButton.rate);
                  },
                ),
              ];
            },
            ignoreNativeDialog:
                Platform.isAndroid, // 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.
              titleAlign: TextAlign.center,
              messageAlign: TextAlign.center,
              messagePadding: EdgeInsets.only(bottom: 20),
            ),
            starRatingOptions:
                StarRatingOptions(), // Custom star bar rating options.
            onDismissed: () => rateMyApp.callEvent(RateMyAppEventType
                .laterButtonPressed), // Called when the user dismissed the dialog (either by taping outside or by pressing the "back" button).
          );
              }
        });
      }
    
    bug 
    opened by moosalim 6
  • The Text Color for The buttons Rate and others is white and there is no option to change it.

    The Text Color for The buttons Rate and others is white and there is no option to change it.

    The Text Color for The buttons Rate and others is white and there is no option to change it. I can't seem to change the colour. Please help

    My Implementation rateMyApp.init().then((_) { rateMyApp.conditions.forEach((condition) { if (condition is DebuggableCondition) { print(condition.valuesAsString); } }); if (rateMyApp.shouldOpenDialog) { rateMyApp.showRateDialog( context, title: 'Your Feedback', message: 'If you like this app, please take a little bit of your time to review it!', rateButton: 'Rate', // noButton: 'NO THANKS', laterButton: 'Maybe Later', dialogStyle: const DialogStyle( //dialogShape: ShapeBorder, titleAlign: TextAlign.center, titleStyle: TextStyle( color: Colors.black, ), ), ignoreNativeDialog: true, onDismissed: () => rateMyApp.callEvent(RateMyAppEventType.laterButtonPressed), ); } });

    Screenshots Screenshot_1670324470

    Additional context Add any other context about the problem here.

    bug 
    opened by Pbonmars-20031006 3
  • Star rate + Comment not available at once ?

    Star rate + Comment not available at once ?

    I'm trying to display/show both star rating and comment box at once, but I'm only managing to do one or the other why ? Also remindDaysand remindLaunchesare not working for me it's only showing the first time no matter how many time I restart app not sure what I'm doing wrong

    image image

     ` return RateMyAppBuilder(
        rateMyApp: RateMyApp(
            googlePlayIdentifier: '',
            appStoreIdentifier: '',
            minDays: 0,
            minLaunches: 1,
            remindDays: 0,
            remindLaunches: 1,
        ),
      onInitialized: (context, rateMyApp) {
          if(mounted) {
            setState(() => this.rateMyApp = rateMyApp);
          }
        if (rateMyApp.shouldOpenDialog) {
          rateMyApp.showStarRateDialog(
            context,
            //contentBuilder: (context, _) => buildComment(context),
            title: 'Rate this app',
            message:
            'If you like this app, please take a little bit of your time to review it !',
            actionsBuilder: actionsBuilder,
            ignoreNativeDialog: Platform.isAndroid,
            dialogStyle: const DialogStyle( // Custom dialog styles.
              titleAlign: TextAlign.center,
              messageAlign: TextAlign.center,
              messagePadding: EdgeInsets.only(bottom: 20),
            ),
            starRatingOptions: const StarRatingOptions(initialRating: 4), // Custom star bar rating options.
            onDismissed: () => rateMyApp.callEvent(RateMyAppEventType.laterButtonPressed), // Called when the user dismissed the dialog (either by taping outside or by pressing the "back" button).
          );
        }
      },
        builder: (context) => rateMyApp == null ? Center(child: CircularProgressIndicator()) : widget.builder(rateMyApp),
        );`
    
     Widget buildComment(BuildContext context) => TextFormField(
    autofocus: true,
    onFieldSubmitted: (_) => Navigator.of(context).pop(),
    maxLines: 3,
    decoration: InputDecoration(
        hintText: 'Write Comment...', border: OutlineInputBorder()),
     onChanged: (comment) => setState(() => this.comment = comment),
     );
    
    enhancement 
    opened by zakblacki 0
  • Can't connect to App Store

    Can't connect to App Store

    on submitting the review and then redirecting to App Store , it is showing CANNOT CONNECT TO App Store. This is a big flaw in the package that we can't test it effectively pre release.

    https://user-images.githubusercontent.com/74110158/115163970-d8236100-a0c9-11eb-8cad-52e17d16c159.MP4

    bug 
    opened by abraraltaf92 0
  • Custom actions - Center actions

    Custom actions - Center actions

    Is your feature request related to a problem? Please describe. I want to center the actions buttons I added in the actionsBuilder property on the showRateDialog method. However, as the builder must return a List<Widget>, I cannot specify the alignment.

    Describe the solution you'd like Be able to custom the entire dialog using Widget builder or with an improved DialogStyle class

    Describe alternatives you've considered

    • Specifying the buttons alignment in the dialogStyle property
    • Meeting Flutter standard and change the builder to make it return a Widget as every other ..builder property are doing in the entire framework

    Additional context Your package is really cool and helps! Thanks a lot!

    enhancement 
    opened by flogaribal 2
  • "Rate this app" dialog not showing on android

    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

    bug 
    opened by josephfeleke 3
  • launchStore() not launching Play Store

    launchStore() not launching Play Store

    I tried launching the Play Store, after tapping the "RATE" button displayed by showRateDialog, but instead of launching the Google Play Store, nothing shows up.

    Here is a snippet of code:

    _rateMyApp.showRateDialog(
      context,
      listener: (button) {
        switch (button) {
          case RateMyAppDialogButton.rate:
            print('Launch store');
            _rateMyApp.launchStore().then((result) {
              print('Result $result');
            });
            break;
          default:
        }
        return true;
      },
    );
    

    I already provided the app id to the googlePlayIdentifier argument, at the point of instantiating _rateMyApp.

    print('Result $result');, prints Result: LaunchStoreResult.storeOpened, but the Play Store does not come up.

    bug 
    opened by samueladekunle 1
Owner
Hugo Delaunay
💻 Yet Another Developer
Hugo Delaunay
This project is a NGO which let you donate anything or even let you ask for help to people.

ngo_app This app is written in flutter using dart language. Getting Started This project is a NGO which let you donate anything or even let you ask fo

null 1 May 8, 2022
Ali Türkay AVCI 1 Jan 20, 2022
Github-search - Allows users to search users on github Uses flutter

Github Search Github Search is a cross-platform mobile application powered by Flutter Framework and Github API. The application was built with simplic

Saul 3 Sep 13, 2022
Know where to go safely. Describe your experiences and rate places.

Is It Safe? ?? Índice Sobre Showcase Features Como eu posso rodar o projeto? Ferramentas Instalação Run Suporte Como posso contribuir? Autores Info ??

Is It Safe? 0 Sep 19, 2022
A Simple but elegant Calculator app made with Flutter using Google's Material Design with Currency (Exchange Rate) and Unit Converter.

Calculator A Simple but elegant Calculator app made with Flutter using Google's Material Design with Currency (Exchange Rate) and Unit Converter. Down

Hemant Rajput 15 Dec 7, 2022
A most easily usable improvement rate calculator library in Dart.

A most easily usable improvement rate calculator library in Dart. With ImprovementRate, you can easily calculate improvement rate on your application.

Kato Shinya 1 Dec 27, 2021
Breathe is a mental health blogging app where users can join communities of doctors and other users from around the world and both share their problems as well as lend a ear to and help others

?????????????? ?????????????? In a condensed, suffocating society you can feel closed off, when you can't process your emotions and are going through

Soham Sen 3 May 16, 2022
An app made using the Flutter framework that allows users to track information for over 1500 cryptocurrencies

Platypus Crypto Platypus Crypto is an ad-free cross-platform robust solution for tracking cryptocurrency assets. Our intuitive interface includes real

null 179 Jan 4, 2023
A Flutter package that allows Android users to press the back-button twice to close the app.

double_back_to_close_app A Flutter package that allows Android users to press the back-button twice to close the app. Usage Inside a Scaffold that wra

Hugo Passos 57 Oct 10, 2022
A Flutter package that allows Android users to press the back-button twice to close the app.

double_back_to_close_app A Flutter package that allows Android users to press the back-button twice to close the app. Usage Inside a Scaffold that wra

Hugo Passos 57 Oct 10, 2022
Custom dropdown widget allows to add highly customizable widget in your projects with proper open and close animations and also comes with form required validation.

Custom Dropdown Custom Dropdown package lets you add customizable animated dropdown widget. Features Lots of properties to use and customize dropdown

Abdullah Chauhan 22 Dec 29, 2022
This is flutter package for creating a gender selection widget which allows users to choose a gender with cool animations

gender_selection A Flutter package for gender selection. It is an aweome gender selection widget with cool gradients and animation effects Demo Instal

Rohan Malik 10 Apr 8, 2022
A flutter application that allows users to test their knowledge through quizzes made for specific topics.

Quiz_App A flutter application that allows users to test their knowledge through quizzes made for specific topics. Setup The application consists of a

null 0 Dec 29, 2021
BubbleShowcase is a small but power flutter package that allows you to highlight specific parts of your app to explain them to the user or to showcase your app new features.

BubbleShowcase BubbleShowcase is a small but powerful flutter package that allows you to highlight specific parts of your app (to explain them to the

Hugo Delaunay 38 Oct 26, 2022
best flutter / dart practices + Custom Painter + Sliver App Bar + Custom Scrollview

Weekly Budget Flutter App A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get yo

Mohamed Awnallah 4 Oct 21, 2021
A customizable carousel slider widget in Flutter which supports inifinte scrolling, auto scrolling, custom child widget, custom animations and built-in indicators.

flutter_carousel_widget A customizable carousel slider widget in Flutter. Features Infinite Scroll Custom Child Widget Auto Play Horizontal and Vertic

NIKHIL RAJPUT 7 Nov 26, 2022
Flutter package that provides you custom clippers to help you achieve various custom shapes.

flutter_custom_clippers Flutter package that provides you custom clippers to help you achieve various custom shapes. Usage To use this plugin, add flu

Damodar Lohani 291 Dec 23, 2022