Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ The number of significant application events that have been recorded since the c

The average number of times per week that the current version of the app has been used (launched).

@property (nonatomic, readonly) NSUInteger userRatingCountForCurrentVersion;

The number of user ratings for the current version, in the country specified by the `appStoreCountry` property.

@property (nonatomic, assign) BOOL declinedThisVersion;

This flag indicates whether the user has declined to rate the current version (YES) or not (NO). This is not currently used by the iRate prompting logic, but may be useful for implementing your own logic.
Expand Down
4 changes: 4 additions & 0 deletions iRate/iRate.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ typedef NS_ENUM(NSUInteger, iRateErrorCode)
@property (nonatomic, assign) NSUInteger usesCount;
@property (nonatomic, assign) NSUInteger eventCount;
@property (nonatomic, readonly) float usesPerWeek;
@property (nonatomic, readonly) float averageUserRating;
@property (nonatomic, readonly) NSUInteger userRatingCount;
@property (nonatomic, readonly) float averageUserRatingForCurrentVersion;
@property (nonatomic, readonly) NSUInteger userRatingCountForCurrentVersion;
@property (nonatomic, assign) BOOL declinedThisVersion;
@property (nonatomic, readonly) BOOL declinedAnyVersion;
@property (nonatomic, assign) BOOL ratedThisVersion;
Expand Down
24 changes: 23 additions & 1 deletion iRate/iRate.m
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ - (iRate *)init
self.promptForNewVersionIfUserRated = NO;
self.onlyPromptIfLatestVersion = YES;
self.onlyPromptIfMainWindowIsAvailable = YES;
self.promptAtLaunch = YES;
self.promptAtLaunch = NO;
self.usesUntilPrompt = 10;
self.eventsUntilPrompt = 10;
self.daysUntilPrompt = 10.0;
Expand Down Expand Up @@ -766,6 +766,26 @@ - (void)checkForConnectivity
error = [NSError errorWithDomain:iRateErrorDomain code:iRateErrorApplicationIsNotLatestVersion userInfo:@{NSLocalizedDescriptionKey: @"Installed app is not the latest version available"}];
}
}

if (self.userRatingCount == 0)
{
_userRatingCount = [[self valueForKey:@"userRatingCount" inJSON:json] integerValue];
}

if (self.averageUserRating == 0.0)
{
_averageUserRating = [[self valueForKey:@"averageUserRating" inJSON:json] floatValue];
}

if (self.userRatingCountForCurrentVersion == 0)
{
_userRatingCountForCurrentVersion = [[self valueForKey:@"userRatingCountForCurrentVersion" inJSON:json] integerValue];
}

if (self.averageUserRatingForCurrentVersion == 0.0)
{
_averageUserRatingForCurrentVersion = [[self valueForKey:@"averageUserRatingForCurrentVersion" inJSON:json] floatValue];
}
}
else
{
Expand Down Expand Up @@ -850,6 +870,7 @@ - (BOOL)showCancelButton

- (void)promptForRating
{
#if FALSE
if (!self.visibleAlert)
{
NSString *message = self.ratedAnyVersion? self.updateMessage: self.message;
Expand Down Expand Up @@ -972,6 +993,7 @@ - (void)promptForRating
[[NSNotificationCenter defaultCenter] postNotificationName:iRateDidPromptForRating
object:nil];
}
#endif
}

- (void)applicationLaunched
Expand Down