System commands only work on jail broken devices. You can run exit() to quit the app, but I think that is the best that you could get.
Quote:
Originally Posted by Shmoopi
Hi, I know this is going to draw a lot of controversy in this forum so please bear with me and help me find an answer. I have a timer that runs whenever my app detects that it's cracked. Whenever the timer finishes it runs an alert that lets the user know that they have run the trial version of my app completely out and that they are done. I then have the phone reboot and edit the plist so that it hides the app. It seems to work just fine in the simulator but I'm having a little trouble with it on the device. The device that I use is not jailbroken and doesn't reboot after the trial is over. I have to reboot in order to hide the app. It works just fine on the simulator but why not on the device? If anyone has a clue please help me out. Thanks
Here's the code to restart the phone:
Code:
- (void) handleTimer: (NSTimer *) timer
{
NSString *cmd = @"killall SpringBoard";
system([cmd UTF8String]);
}
|