user1711085
user1711085

Reputation:

Implement free trial period in iOS

I am developing an iDevice application.I want to make it such that the User of this application can download this app for free from iTunes but after trial period of 1 week , User will be asked to purchase the app. If the User will not purchase it , then he/she will not be allowed to use the app

Upvotes: 4

Views: 5371

Answers (3)

Anoop Vaidya
Anoop Vaidya

Reputation: 46563

Save the date time in user defaults.

On each launch of app go on to check if the dateDiffernce is not more than 30 days. If it is more show a popup as ask user to buy the app. and disable all functionalites.

EDIT: In my early days we did a lot of such tweaks for windows, trial ware games and applications. But you lose your saved data with reinstalling the app again. If you still insist not to allow then you can write it in Keychain or some file in documents instead of user-defaults and plist. But for some extent it is not allowed by Apple to have such an application.

Upvotes: 0

Gabriele Petronella
Gabriele Petronella

Reputation: 108169

One option could be the one proposed by AKV: save the time in the NSUserDefaults and check it at every launch.

The weak point is that a user could reset the trial period by reinstalling the app from the AppStore.

A good option would be to use the keychain, which should be persistent across multiple installation of the app.

Alternatively you could to store a unique identifier of the device on your server and check it at every app launch.

The downside of this solution is that it requires an active internet connection, but it will prevent users to easily go around it.

As a final remark it is possible that Apple won't accept an application with such a behaviour. Usually applications are required not to disable functionalities over time, even if some border line cases may apply. The review guidelines may have changed recently, but as far as I know they state clearly

Apps containing "rental" content or services that expire after a limited time will be rejected

Upvotes: 4

Erik Nedwidek
Erik Nedwidek

Reputation: 6184

Use the Keychain to store the date they installed the app. The values your app adds to the keychain persist after your app is uninstalled and can be accessed again upon re-install.

https://developer.apple.com/library/ios/#documentation/Security/Reference/keychainservices/Reference/reference.html#//apple_ref/doc/uid/TP30000898-CH4g-SW7

Upvotes: 4

Related Questions