Disable home button

Discussion in 'iOS Development' started by iamcanadian, Mar 11, 2008.

  1. iamcanadian

    iamcanadian New Member

    Joined:
    Nov 29, 2007
    Messages:
    335
    Likes Received:
    15
    How could i make it so the home button dosent exit my app unless you hold it down or press it X amount of times, im using jiggy to make my app
  2. Commander147

    Commander147 Member

    Joined:
    Oct 10, 2007
    Messages:
    78
    Likes Received:
    4
    Device:
    iPhone 4 (Black)
    Im not sure that you can do this at the moment but if you use a terminal command you can make it so that the User can not close down your application unless the process is killed in the command line. What I would do is freeze it so that the User can't exit and set a variable to increment by one everytime the Home button is pressed. When A certain number of presses is reached Make the app send a terminal command to kill its own process. It is a bit crude but It should work.
  3. iamcanadian

    iamcanadian New Member

    Joined:
    Nov 29, 2007
    Messages:
    335
    Likes Received:
    15
    Ok makes sence but how do i know if the home button has been pressed. ive looked high and low for anything regarding the home button.

    btw: your tutorial got me started on jiggy thanks for all the help.
  4. Commander147

    Commander147 Member

    Joined:
    Oct 10, 2007
    Messages:
    78
    Likes Received:
    4
    Device:
    iPhone 4 (Black)
    thanks for the complement .I am not sure on how tp tell how many times the home button has been pressed but I did post on the JIggy Dev group for help. I will let you know as soon as I get an answer.
  5. iamcanadian

    iamcanadian New Member

    Joined:
    Nov 29, 2007
    Messages:
    335
    Likes Received:
    15
    thanks again for the help! and i really learning alot even by just makeing a siple app screen crack sim app.
    BTW: just wondering are you still working on the second tutorial beacuse if you are im excited hah.
  6. Commander147

    Commander147 Member

    Joined:
    Oct 10, 2007
    Messages:
    78
    Likes Received:
    4
    Device:
    iPhone 4 (Black)
    I had part of it done but I am not close to finished with it I kinda had to back of a bit of making tutorial because of school.
  7. iamcanadian

    iamcanadian New Member

    Joined:
    Nov 29, 2007
    Messages:
    335
    Likes Received:
    15
    fair enough i know what you mean, collage or high school
    im in high school and know it can get pretty stressful sometimes, id assume collage is worse.
    i did like your tutorial because it was more than a hello world.
  8. JonSingh12

    JonSingh12 New Member

    Joined:
    Nov 12, 2007
    Messages:
    591
    Likes Received:
    8
    Device:
    iPad w/ 3G
    do this

    onUnload = executeShellCommand("cd /Applications/Appname.app/; ./jiggy &");

    replace app name with the name of your app. This will relaunch your app right away after it is pressed the first time. Then the next time it is disabled where you cannot exit the program at all. You'll need to embed an exit button in your app.

    To exit the app set up a button input of some sort then run these commands command
    {
    Application.removeApplicationBadge();
    terminate();
    }

Share This Page