RateMe 1.0.1

RateMe 1.0.1

Maintained by Kadir Kemal Dursun.



RateMe 1.0.1

  • By
  • kadirkemal

RateMe

CI Status Version License Platform

Getting five star comments are very important for every application. RateMe helps you to track your users and warn you when the application is used by a satisfied user.

Installation

RateMe is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'RateMe'

Thread Safety

RateMe uses GCD to avoid blocking the UI. RateMe uses a serial GCD queue to avoid race conditions.

Usage

Sample 1

Think that you want to warn the users who open the product detail page 4 times.

Initiaze RateMe in the AppDelegate

#import <RateMe/RateMe.h>

@interface ZngAppDelegate()<RateMeDelegate>
@end

@implementation ZngAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.

//VisitDetailPage is the triggerName
[[RateMe sharedInstance] addConditionWithName:@"VisitDetailPage" count:4];
[RateMe sharedInstance].delegate = self;

return YES;
}

-(void)onRateMeTime{
[SKStoreReviewController requestReview];
}

@end

Send trigger to RateMe in viewDidLoad of the ProductDetailViewController

- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.

//use the same name for the trigger
[[RateMe sharedInstance] trigger:@"VisitDetailPage"];
}

Sample 2

Think that you want to warn the users who open the product detail page 4 times OR who login once.

Initiaze RateMe in the AppDelegate

#import <RateMe/RateMe.h>

@interface ZngAppDelegate()<RateMeDelegate>
@end

@implementation ZngAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
[[RateMe sharedInstance] addConditionWithName:@"VisitDetailPage" count:4];
[[RateMe sharedInstance] addConditionWithName:@"Login" count:1];
[RateMe sharedInstance].delegate = self;

return YES;
}

-(void)onRateMeTime{
[SKStoreReviewController requestReview];
}

@end

Send trigger to RateMe in viewDidLoad of the ProductDetailViewController

- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.

[[RateMe sharedInstance] trigger:@"VisitDetailPage"];
}

Send trigger to RateMe when the user loggin

[[RateMe sharedInstance] trigger:@"Login"];

You can add infinitive OR statement by using addConditionWithName or addConditionWithNameList or addCondition methods.

Sample 3

You can use addConditionWithNameList method when the total number of some triggers reaches to wanted count.

#import <RateMe/RateMe.h>

@interface ZngAppDelegate()<RateMeDelegate>
@end

@implementation ZngAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
[[RateMe sharedInstance] addConditionWithNameList:@[@"trigger1", @"trigger2"] count:5];
[RateMe sharedInstance].delegate = self;

return YES;
}

-(void)onRateMeTime{
[SKStoreReviewController requestReview];
}

@end

When the total number of trigger1 and trigger2 reaches to 5, onRateMe events will be called.

Sample 4

For AND conditions you need to create your own conditions.

#import <RateMe/RateMe.h>

@interface ZngAppDelegate()<RateMeDelegate>
@end

@implementation ZngAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
RateMeCondition *condition1 = [RateMeCondition rateMeConditionWithTriggerName:@"trigger1" count:3];
RateMeCondition *condition2 = [RateMeCondition rateMeConditionWithTriggerName:@"trigger2" count:4];
RateMeCondition *condition3 = [RateMeCondition rateMeConditionWithTriggerNameList:@[@"trigger3", @"trigger4" , @"trigger5"]  count:5];

RateMeCondition *andConditions = [RateMeCondition rateMeConditionWithConditionList:@[condition1, condition2, condition3]];
[[RateMe sharedInstance] addCondition:andConditions];

[RateMe sharedInstance].delegate = self;

return YES;
}

-(void)onRateMeTime{
[SKStoreReviewController requestReview];
}

@end

onRateMe events will be called when trigger1 is occurred 3 times, trigger2 is occured 4 times and the total occuring number of trigger3,trigger4 and trigger5 reaches to 5.

Changing Delay Time

When trigger count reaches to wanted number, RateMe waits some seconds (default is 10 seconds) before calling the onRateMeTime method. If you want to change this duration;

[RateMe sharedInstance].delayDuration = 5; //now delayDuration is 5 seconds

Author

Zingat Mobile Team

License

RateMe is available under the MIT license. See the LICENSE file for more info.