Reputation: 635
I have done with my app. it's a game. now user starts to play,n when he played game for 3 times I want to request that particular user to review this app which is in In-app-purchase. This will increase rankings and downloads of my app. So how can I do this?
Upvotes: 3
Views: 128
Reputation: 3480
Its for the condition that how many times you play the game
I have done this function in my app, you just store the status of the app in NSUserDefault
like one time play 2,3 times play just store the status and at the beginning of the game every time check the condition of the value stored in NSUserDefault if the counter(NSUserDefault
value) is greater than 3 than call the delegates of InApp Purchase and go ahead best luck.
You can do like:-
NSInteger counter=[[NSUserDefaults standardUserDefaults]integerForKey:@"value"];
if (counter)
{
counter=counter + 1; // counter ++
[[NSUserDefaults standardUserDefaults]setInteger:counter forKey:@"value"];
}
else
{
[[NSUserDefaults standardUserDefaults]setInteger:1 forKey:@"value"];
}
// At the beginning of the game check the condition.
if (counter > 3)
{
// Call InApp Purchase
}
Upvotes: 1