|
|
|||||||||||||
![]() |
|||||||||||||
|
![]() |
||||||||||||
|
The Registration User Interface Saturday, May 17, 2008 Now that I know what I want my registration numbers to look like, I want to design the application’s user interface for the registration process.
Like most shareware applications, I want to offer a full working version of the program when it’s first downloaded. This will give users a chance to play with all of the features to determine if they want to purchase the program. Of course, if the program remains fully functional then there’s little incentive for them to purchase it, so after some number of days I want the program to either stop working, or run with some reduced functionality.
When my application launches, I want to inform the user that there’s a trial period involved, and warn them about how many days remain in the trial. From this screen they should be able to go to the purchase page on my website, enter a registration code if they’ve purchased a license, or just dismiss the dialog and use the program.
So I whipped up this dialog in Interface Builder:
![]()
Since I want this to be a generic solution that I can easily use in multiple projects, everything here is generic and will be set at runtime to application specific values. For example, the icon will be replaced with the application’s icon, the CFBundleName and CFBundleVersion text fields will actually display the application’s name and version number from the application’s info.plist file. And the “xx” in the text will be replaced with the number of trial days allowed and remaining.
To keep track of the number of trial days remaining, I’ll need to store the trial start date somewhere. I could do this quite easily in the user’s preferences file. But if the user wants to restart the trial period, the first thing they’re probably going to do is to look in the application’s preferences file to see if that’s where the trial start date is stored. If it is, they could edit the date or just toss out the preferences.
To make resetting the start date just slightly more difficult, I’ve decided to store it in a separate hidden plist file on the system. I can hide it either by actually making the file invisible, or by just giving it a deceptive file name that will blend in with other system file names. Or I can do both. Now the user has to find this hidden file to restart the trial period.
I could get really fancy and store the start date in both the user’s preferences file and a hidden file, or in multiple hidden files on the system, then compare the two to make sure they match. Most users wouldn’t be able to figure out that they need to delete both files simultaneously to restart the demo. But as I stated earlier, I’m really just trying to keep the honest people honest. So I’m going for simplicity instead.
Back to the dialog, if the Register button is clicked I’ll need another dialog where the user’s name and registration code can be entered:
![]()
When this information is entered, I’ll run it through my validation routine to make sure the registration code is valid for the user name. If it is, then I need to store the user name and registration code so I can automatically verify it again the next time the program is launched. Once again, I could store these values in the user preferences file. Browsing through the preference files on my system, it’s obvious that many applications do this. But since I’ve already created another file for the trial start date, I might as well use that same hidden file. This will allow the user to throw out the preferences file without unregistering the program, and prevent other users on the machine from snagging a copy of the registration information if they happen to notice it in the application’s preferences file.
There’s one last thing I wan to handle while I’m here. I want to display the application’s software license the first time the program is launched.
The user will need to click the Accept button to use the software. If they instead click Decline, the program will just quit. But if they click Accept, I want to store a Boolean value so I know I don’t need to display the license agreement the next time the program launches. Again, the hidden file is a good place to do this.
| |||||||||||||