Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added +setShowPreliminaryMessage: to optionally display a preliminary message #173

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
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
33 changes: 28 additions & 5 deletions Appirater.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
*/

#import <Foundation/Foundation.h>
#import "AppiraterDelegate.h"
#import <StoreKit/StoreKit.h>
#import "AppiraterDelegate.h"

extern NSString *const kAppiraterFirstUseDate;
extern NSString *const kAppiraterUseCount;
Expand All @@ -57,7 +57,20 @@ extern NSString *const kAppiraterReminderRequestDate;
#define APPIRATER_APP_NAME APPIRATER_LOCALIZED_APP_NAME ? APPIRATER_LOCALIZED_APP_NAME : [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"]

/*!
This is the message your users will see once they've passed the day+launches
This is first message your users will see once they've passed the day+launches
threshold.
*/
#define APPIRATER_LOCALIZED_PRELIMINARY_MESSAGE_TITLE NSLocalizedStringFromTableInBundle(@"%@", @"AppiraterLocalizable", [Appirater bundle], nil)
#define APPIRATER_PRELIMINARY_MESSAGE_TITLE [NSString stringWithFormat:APPIRATER_LOCALIZED_PRELIMINARY_MESSAGE_TITLE, APPIRATER_APP_NAME]

#define APPIRATER_LOCALIZED_PRELIMINARY_MESSAGE NSLocalizedStringFromTableInBundle(@"Are you enjoying %@?", @"AppiraterLocalizable", [Appirater bundle], nil)
#define APPIRATER_PRELIMINARY_MESSAGE [NSString stringWithFormat:APPIRATER_LOCALIZED_PRELIMINARY_MESSAGE, APPIRATER_APP_NAME]

#define APPIRATER_PRELIMINARY_MESSAGE_YES_BUTTON NSLocalizedStringFromTableInBundle(@"Yes", @"AppiraterLocalizable", [Appirater bundle], nil)
#define APPIRATER_PRELIMINARY_MESSAGE_NO_BUTTON NSLocalizedStringFromTableInBundle(@"No", @"AppiraterLocalizable", [Appirater bundle], nil)

/*!
This is the message your users will see once they've seen the first message
threshold.
*/
#define APPIRATER_LOCALIZED_MESSAGE NSLocalizedStringFromTableInBundle(@"If you enjoy using %@, would you mind taking a moment to rate it? It won't take more than a minute. Thanks for your support!", @"AppiraterLocalizable", [Appirater bundle], nil)
Expand Down Expand Up @@ -86,11 +99,16 @@ extern NSString *const kAppiraterReminderRequestDate;
#define APPIRATER_RATE_LATER NSLocalizedStringFromTableInBundle(@"Remind me later", @"AppiraterLocalizable", [Appirater bundle], nil)

@interface Appirater : NSObject <UIAlertViewDelegate, SKStoreProductViewControllerDelegate> {

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
UIAlertView *ratingAlert;
#pragma clang diagnostic pop
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
@property(nonatomic, strong) UIAlertView *ratingAlert;
#pragma clang diagnostic pop
@property(nonatomic) BOOL openInAppStore;
#if __has_feature(objc_arc_weak)
@property(nonatomic, weak) NSObject <AppiraterDelegate> *delegate;
Expand Down Expand Up @@ -191,6 +209,11 @@ extern NSString *const kAppiraterReminderRequestDate;
*/
+ (void) setAppId:(NSString*)appId;

/*!
Users will see a preliminary message before asked to rate the app.
*/
+ (void) setShowPreliminaryMessage:(BOOL)showPreliminaryMessage;

/*!
Users will need to have the same version of your app installed for this many
days before they will be prompted to rate it.
Expand Down Expand Up @@ -281,14 +304,14 @@ extern NSString *const kAppiraterReminderRequestDate;

Calls [Appirater appLaunched:YES]. See appLaunched: for details of functionality.
*/
+ (void)appLaunched __attribute__((deprecated));
+ (void)appLaunched;

/*!
DEPRECATED: While still functional, it's better to use
tryToShowPrompt instead.

Calls [Appirater tryToShowPrompt]. See tryToShowPrompt for details of functionality.
*/
+ (void)showPrompt __attribute__((deprecated));
+ (void)showPrompt;

@end
Loading