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 custom alert support #236

Open
wants to merge 8 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
35 changes: 17 additions & 18 deletions Appirater.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
*/

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

extern NSString *const kAppiraterFirstUseDate;
extern NSString *const kAppiraterUseCount;
Expand Down Expand Up @@ -85,24 +85,28 @@ 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;

@protocol AppiraterAlert <NSObject>

- (void)show;

- (BOOL)isVisible;

- (void)hide;

@end

@interface Appirater : NSObject <UIAlertViewDelegate, SKStoreProductViewControllerDelegate>

@property(nonatomic, strong) id<AppiraterAlert> ratingAlert;
#if __has_feature(objc_arc_weak)
@property(nonatomic, weak) NSObject <AppiraterDelegate> *delegate;
#else
@property(nonatomic, unsafe_unretained) NSObject <AppiraterDelegate> *delegate;
#endif

+ (Appirater*)sharedInstance;

/*!
Tells Appirater that the app has launched, and on devices that do NOT
support multitasking, the 'uses' count will be incremented. You should
Expand Down Expand Up @@ -288,11 +292,6 @@ extern NSString *const kAppiraterReminderRequestDate;
*/
+ (void)setUsesAnimation:(BOOL)animation;

/*!
If set to YES, Appirater will open App Store link (instead of SKStoreProductViewController on iOS 6). Default YES.
*/
+ (void)setOpenInAppStore:(BOOL)openInAppStore;

/*!
If set to YES, the main bundle will always be used to load localized strings.
Set this to YES if you have provided your own custom localizations in AppiraterLocalizable.strings
Expand Down
Loading