nicklockwood / iRate

[DEPRECATED]
http://charcoaldesign.co.uk/source/cocoa#irate
Other
4.1k stars 734 forks source link

Significant event issue? #297

Open JulesMoorhouse opened 7 years ago

JulesMoorhouse commented 7 years ago

I'm not sure if this is an issue or I've setup something wrong, however on my significant event, the prompt to rate the app happens each time, however I have eventsUntilPrompt set to 5.

I would like the rating dialog to display immediately after 5 significant events have occurred.

Here's my implementation...

App Delegate

ifdef FREEMIUM

[iRate sharedInstance].appStoreID = 123;

else

[iRate sharedInstance].appStoreID = 456;

endif

[iRate sharedInstance].daysUntilPrompt = 3;
[iRate sharedInstance].usesUntilPrompt = 5;
[iRate sharedInstance].eventsUntilPrompt = 5;
[iRate sharedInstance].verboseLogging = NO;
[iRate sharedInstance].remindPeriod = 1;
[iRate sharedInstance].promptAtLaunch = YES;
[iRate sharedInstance].useUIAlertControllerIfAvailable = YES;
[iRate sharedInstance].delegate = self;
[iRate sharedInstance].onlyPromptIfLatestVersion = YES;
[iRate sharedInstance].applicationName = @"Balance Guide";

Call significant event

    [[iRate sharedInstance] promptForRating];

Looking back at the documentation, promptForRating happens immediately, should I be using promptIfAllCriteriaMet instead? Oh I think I may need to use logEvent, however I'm not sure how I then call iRate? Maybe I need to check eventCount then use PromptForRating, however do I then need to reset the number of events ?

nicklockwood commented 7 years ago

You shouldn't need to call [[iRate sharedInstance] promptForRating]; at all. It will automatically display the prompt once all criteria are met. The promptForRating method is only needed if you want to have a "rate now" button in your settings or something.

JulesMoorhouse commented 7 years ago

Sorry I updated my question. I would like the rating dialog to display immediately after 5 significant events have occurred.

JulesMoorhouse commented 7 years ago

So do I need to use logEvent to increment and a condition of eventCount with PromptForRating ? But surely I need to reset the event count ? Actually I shouldn't really show it again afterwards.

nicklockwood commented 7 years ago

If you use -[[iRate sharedInstance] logEvent: YES] the prompt will show immediately after you've called iteventsUntilPrompt times, provided that the other criteria have also been met.

JulesMoorhouse commented 7 years ago

Thanks, is there a method to show the dialog just based on reaching eventsUntilPrompt?

If not if I checked the eventCount and used PromptForRating, code I stop the rating being shown once other criteria was met? I don't want to ask them again once I've had 5 significant events and asked them.