UrbanApps / UAAppReviewManager

UAAppReviewManager is a simple and lightweight App review prompting tool for iOS and Mac App Store apps. It's Appirater all grown up, ready for primetime.
MIT License
801 stars 117 forks source link

Add support for block callbacks for deciding whether to prompt if rated according to version #3

Closed LeoNatan closed 11 years ago

LeoNatan commented 11 years ago

Currently, there is "setShouldPromptIfRated:" and in the comment, it is said to pass YES value for major versions and NO for minor versions.

I propose the following optional API:

typedef BOOL (^UAAppReviewManagerShouldPromptBlock) (NSString* previousVersion, NSString* currentVersion);

If this is set, before prompting, a call will be made to the user's passed block to determine whether the current build is minor or major (or any other logic).

Thanks, Leo

coneybeare commented 11 years ago

Currently, there is a way to configure whether or not it will prompt on the current build version, but it is setup through combinations of the tracksNewVersions and shouldPromptIfRated properties, but I like the idea of having any logic be applied here. If you throw something together, I would be happy to take a look at it, otherwise I can probably look into adding this in a couple of weeks.

coneybeare commented 11 years ago

Check out the prompt-blocks branch and let me know if this meets your expectations on the feature.

LeoNatan commented 11 years ago

Looks great, thanks!

A few comments: I see the blocks are called in a low priority queue. Consider adding to the documentation that the "shouldPrompt" blocks will be called on an arbitrary thread. This may prevent confusion of expecting the callback on the main thread and so on. A few minor spelling mistakes I noticed - "diaplay", capitalized "Similar", etc.

Great job, thank you!

coneybeare commented 11 years ago

Updated to run shouldPromptBlock on main thread. Maybe you can help out by merging and testing. I am currently on a flight and my battery is just about dead, then am unavailable for about a week. If all is good, I will merge into master when I get back.

LeoNatan commented 11 years ago

I will try. Thanks

LeoNatan commented 11 years ago

Oops, sorry, didn't mean to close.

coneybeare commented 11 years ago

Added: https://github.com/UrbanApps/UAAppReviewManager/commit/c9ca5b237bfb150ce55ee991c4a35ba7c8168cc5