apptentive / apptentive-android

Apptentive Android SDK
http://www.apptentive.com
BSD 3-Clause "New" or "Revised" License
65 stars 64 forks source link

ratings module not showing up #56

Closed schilakamarri closed 10 years ago

schilakamarri commented 10 years ago

I debugged and narrowed it down to this line in RatingModule.java:

boolean canShow = canShowRatingFlow(prefs);

The canShow is always False even when conditions are met. Can you please look into it?

skykelsey commented 10 years ago

Thanks for the report.

I'm sorry you're having this problem. I'm going to look into this and see what's going on. Can you please make the following checks?

On the website: 1.Verify that the "Enable Ratings Dialog" checkbox is checked.

  1. Verify that you had a working internet connection to the device when you tried to launch the rating module.
  2. Make sure that you haven't previous launched the rating module. We will only ever show the rating module once per app version per user, unless the user asked us to remind them. To test this over and over again, you can go into your app's settings and reset the app data.
  3. If none of these solve your problem, please let me know what your app's rating logic settings are

Thanks! Sky

schilakamarri commented 10 years ago

Hi Sky,

We fixed it in the following class:

RatingModule.java Replaced Line: return days != 0 && now > periodEnd; with: return days == 0 || now > periodEnd;

Isuue is fixed with that replacement.

skykelsey commented 10 years ago

Hi,

Actually, this is not a fix. We currently use 0 to represent disabling that particular setting. If you set all of the settings to 0, then the rating prompt will never be shown. It is documented this way on the settings page. If you would like to show the prompt immediately the first time the app starts, set everything to 0 except set 1 for app uses. And please revert your change. It is not actually a fix.

Thanks, Sky

schilakamarri commented 10 years ago

Thank you Sky. This change made in the code works as expected for me. I want the rating module to show up after I log logSignificantEvent 3 times. I see the rating module appear when the logSignificantEvent is logged 3 times. I will revert the fix in my code, but when is this expected to be fixed from Apptentive?

schilakamarri commented 10 years ago

Also added the following code change to Rating Module.java: private boolean eventThresholdReached(SharedPreferences prefs) { @@ -322,12 +322,16 @@ void run(Activity activity) { private boolean canShowRatingFlow(SharedPreferences prefs) { Configuration config = Configuration.load(prefs); String ratingsPromptLogic = config.getRatingsPromptLogic();

skykelsey commented 10 years ago

This isn't a bug, so it won't be fixed. It sounds like it is working properly for you when you set 3 for significant events. I would set OR logic, with 3 for significant events, and 0 for the other settings.

schilakamarri commented 10 years ago

Will try that and update tomorrow. Thank you

schilakamarri commented 10 years ago

Thank you Sky. I changed the app settings to OR logic and it works as expected with SDK code as it is.