-3

How can I can check if the user has downloaded my app before a specific date? I have this code in the viewDidLoad:

    if([[NSUserDefaults standardUserDefaults]boolForKey:@"FirstLaunch"]){
}
else{
    [[NSUserDefaults standardUserDefaults]setBool:YES forKey:@"FirstLaunch"];
    [[NSUserDefaults standardUserDefaults]synchronize];
}

I there any way for my to use that NSUserDefaults and make a method like :

If(Firstlaunch>today){ remove iAd }

any code would be greatly appreciated! sorry if the question is dumb..

user2891448
  • 363
  • 1
  • 4
  • 7
  • 5
    Why are you repeating your previous question: http://stackoverflow.com/questions/22108302/is-it-possible-to-check-when-user-downloaded-my-ios-app – rmaddy Mar 01 '14 at 18:40
  • Check the `Original Purchase Date` on the purchase receipt (there are other questions about this on StackOverflow:http://stackoverflow.com/questions/19943183/a-complete-solution-to-locally-validate-an-in-app-receipts-and-bundle-receipts-o). Link to documentation: https://developer.apple.com/library/ios/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html – Robotic Cat Mar 01 '14 at 19:10

1 Answers1

2

Option 1. Ship the app with a hardcoded date value you would compare with on app's first launch.

Option 2. Implement a web service and send a call on app's first launch. The web service would check if the date of performing a request is in a desired range and return this information to you in a response.

Rafał Sroka
  • 39,540
  • 23
  • 113
  • 143