I have used the iRate class to add 'rate my app' functionality. I have added my app bundle ID. But when I run the app it shows "Cannot connect to iTunes Store". Please help me out to find the issue.
This is the code I'm using:
-(void)applicationWillEnterForeground:(UIApplication *)application
{
NSUserDefaults *times=[NSUserDefaults standardUserDefaults];
int test=[[times objectForKey:@"time"]intValue];
NSLog(@"test..:%d",test);
if (test >=5) {
[iRate sharedInstance].applicationBundleID = @"com.01Synergy";
[iRate sharedInstance].onlyPromptIfLatestVersion = NO;
//enable preview mode
[iRate sharedInstance].previewMode = YES;
}
}
- (void)applicationDidEnterBackground:(UIApplication *)application {
NSUserDefaults *times=[NSUserDefaults standardUserDefaults];
int time=[[times objectForKey:@"time"]intValue];
if (time<5) {
time++;
[times setInteger:time forKey:@"time"];
}
}
Not familiar with iRate, I often uses Appirater. It is extremely easy to implement. Simple call
[Appirater setAppId:@"380245121"]; // Change for your "Your APP ID"
[Appirater setDaysUntilPrompt:0]; // Days from first entered the app until prompt
[Appirater setUsesUntilPrompt:5]; // Number of uses until prompt
[Appirater setTimeBeforeReminding:2]; // Days until reminding if the user taps "remind me"
//[Appirater setDebug:YES]; // If you set this to YES it will display all the time
to have it show after the user have entered the app the 5th time!
Say you have done [Appirater setUsesUntilPrompt:5]
and [Appirater setDaysUntilPrompt:2]
it means that the time from first app entry has to be 2 days (or more) AND the number of app uses (number of times the application entered foreground/launched) has to be 5 times (or more).
Sample code for your purpose:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[Appirater setAppId:@"380245121"]; // Change for your "Your APP ID"
[Appirater setDaysUntilPrompt:0]; // Days from first entered the app until prompt
[Appirater setUsesUntilPrompt:5]; // Number of uses until prompt
[Appirater setTimeBeforeReminding:2]; // Days until reminding if the user taps "remind me"
//[Appirater setDebug:YES]; // If you set this to YES it will display all the time
//... Perhaps do stuff
[Appirater appLaunched:YES];
return YES;
}
- (void)applicationWillEnterForeground:(UIApplication *)application{
[Appirater appEnteredForeground:YES];
}
If your app is out on App Store you can find the app ID in the URL:
If it is not yet released you can find it by going to iTunes Connect ->> tapping "Manage Your Apps" -->> tapping your app. You app ID will be seen here
Hope it helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With