hotchemi / Android-Rate

Android-Rate is a library to help you promote your android app by prompting users to rate the app after using it for a few days.
http://hotchemi.github.io/Android-Rate
MIT License
720 stars 216 forks source link

How to know which decision user taken? I want to change the AppRate settings at runtime. #90

Closed sandrocsimas closed 8 years ago

sandrocsimas commented 8 years ago

It will be nice if i can get to know what decision the user has taken. I'm trying to do the follow:

I think in something like this:

rateDialog = AppRate.with(this).setInstallDays(7).setCancelable(true);
if(rateDialog.isRemindLater()) {
  rateDialog.setRemindInterval(15);
} else {
  rateDialog.setRemindInterval(7);
}
// OR
if(rateDialog.getUserDecision().equals(UserDecision.REMIND_LATER)) {
  rateDialog.setRemindInterval(15);
} else {
  rateDialog.setRemindInterval(7);
}
rateDialog.monitor();
hotchemi commented 8 years ago

:eyes:

sandrocsimas commented 8 years ago

@hotchemi, what do you think? Hehehehehe.

hotchemi commented 8 years ago

Sorry for the late, I think you can use OnClickButtonListener. onClickButton's argument shows which button is pressed.

https://github.com/hotchemi/Android-Rate/blob/master/library/src/main/java/hotchemi/android/rate/OnClickButtonListener.java#L5

refs. http://developer.android.com/intl/ja/reference/android/content/DialogInterface.html#BUTTON_POSITIVE

sandrocsimas commented 8 years ago

@hotchemi. The problem is that this is information is not stored in any place. When the activity is created again, i don't have this information anymore. I think it will be nice if the lib store this information. When the user clicks, the AppRate could store this in its shared preferences.

In my case i will only show the "REMIND LATER" and the "RATE NOW" buttons. When is the first time that the dialog is displayed, the remind interval could be 0 for example. After "REMIND LATER" click i want to increase the interval to 15 days.

hotchemi commented 8 years ago

I think you can do it by yourself right? I can implement that but not so much people want that feature and I wanna keep this library simple!

sandrocsimas commented 8 years ago

It's very simple, but ok.