0

Possible Duplicate:
Disabling home button on iPhone/iPad

hi developers

i am trying to disable the home button. the reason being my app is designed to be like a convenience store register , the person using the app would be entering the opening and closing balance while loggin in and loggin out of his shift. so when the home button is pressed(accidentally) there is no way of entering the closing balance.i did try some stuff in applicationWillTerminate method in the app delegate , but it did not work. i have put a check mark against "application will not run in background" in the info.plist so that the user has to login again with the password(that takes care of security issue). now , what i was thinking was instead of trying to code in applicationWillTerminate is there anyway i can disable the home button so that the only option left out for the user to logout is the proper logout button.

and last of all , this app will not be in the Appstore , its for a client. i dont have to bother apple rejecting my App for sure.

Community
  • 1
  • 1
Rajashekar
  • 619
  • 9
  • 30
  • As an iPhone owner, I certainly hope there's no way for an application to lock itself on my screen and disable the home button. – David Dec 24 '10 at 11:16
  • Please search Stack Overflow before asking a question. You'll probably find it's already been asked. – Jasarien Dec 24 '10 at 12:00

4 Answers4

2

The only way would be to get a case that covers the home button

StuStirling
  • 15,601
  • 23
  • 93
  • 150
1

IMPOSSIBLE!!! not even an API for a jailbroken phone will have this feature.

try some alternatives:

  • do allow the app to run in the background,

  • but log the user out after 2mins of backgrounding [takare of your security], by saving the current time in applicationWillResignActive and checking it against timeIntervalSinceDate in applicationDidBecomeActive

  • save the closing balance as a variable in NSUserdefaults against that user when logging out due to timeout/terminating and maybe ask him if he wants to enter it in if he logs in again.

0

Short answer: no. You can't do that.

0

I'd be very surprised if this was possible, even using private APIs.

In essence, the operation of the home button is controlled by the underlying OS (the "springboard" app launcher in this case), so it's unlikely to be possible for an application to override or somehow block the "button pressed" message.

That said, some alternatives have been discussed within the existing Disabling home button on iPhone/iPad question.

Community
  • 1
  • 1
John Parker
  • 54,048
  • 11
  • 129
  • 129