Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 06-28-2011, 11:20 AM   #1 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 68
canit210 is on a distinguished road
Default Creating Trial Application

I'm developing a local application not meant for distribution through the App Store, as I only want specific users to be able to install the application. Because I am enrolled in the Enterprise Program all I have to do is email them the Mobile Provisioning file and .app file so they can install it.

However, ideally I would like the app to only be usable for a given time period after they run it for the first time on their device (almost like a movie rental from the iTunes store).

Is there a way to do this in code?
If not in code, is there to do this through the Provisioning Portal?
canit210 is offline   Reply With Quote
Old 06-28-2011, 11:34 AM   #2 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,983
smithdale87 is on a distinguished road
Send a message via AIM to smithdale87
Default

You can do this very simply through code using NSUserDefaults.

The first time the app launches, save an NSDate to NSUserDefaults
Each subsequent time the app launches, load the NSDate described above from NSUserDefaults. Check that difference in that date and the current date to determine if the trial period is up.

The only problem though is that the user would be able to delete and redownload your app and start a new trial period. To avoid this, you would need a server to save the start dates rather than using NSUserDefaults.
smithdale87 is offline   Reply With Quote
Old 06-28-2011, 11:47 AM   #3 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 68
canit210 is on a distinguished road
Default

Quote:
Originally Posted by smithdale87 View Post
You can do this very simply through code using NSUserDefaults.

The first time the app launches, save an NSDate to NSUserDefaults
Each subsequent time the app launches, load the NSDate described above from NSUserDefaults. Check that difference in that date and the current date to determine if the trial period is up.

The only problem though is that the user would be able to delete and redownload your app and start a new trial period. To avoid this, you would need a server to save the start dates rather than using NSUserDefaults.
Awesome!
Thanks for your reply. I'm going to try it out next week
canit210 is offline   Reply With Quote
Reply

Bookmarks

Tags
distribution, provisioning, trial

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 325
7 members and 318 guests
chemistry, iOS.Lover, lendo, leostc, Leslie80, pbart, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,664
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Leslie80
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:29 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0