Disable iphone home button in app, is it possible? - objective-c

I want to develop a screensaver-like app where the only way of getting back to the springboard is entering a code. Therefore I would need the Home Button action to be ignored, that is that when the user presses the button nothing happens..or something custom...instead of going back to the springboard and terminating the app.
Is this possible? does anybody know if apple will approve/reject this kind of app?

The answer to your question is, yes.
The answer to the question you meant to ask--can I ship an app through the iPhone store that has the home button disabled--is no.
If you are only publishing your app to jailbroken phones you can do it, but it will piss everyone off.
Edit 7 years later:
This is actually extremely possible now--there is a standard feature in the iPhone called "Guided Access". It's hidden under that "Accessibility" Link (With some other fairly cool stuff like flashing the LED whenever you get a call and allowing a Bluetooth keyboard to tab between controls)
It's called "Guided Access". You set a passcode, launch the app then triple-click the home button to start guided access.
It disables exit and allows you to designate regions of the screen you can't touch. You can also set a time limit (For kids playing which seems to be the reason a lot of people look up this question).
Tempted to edit the "Accepted answer" and throw this info in there, but that seems rude so I'll just hope people find this answer.
Annoyingly you also seem to be unable to shut off the phone--I suppose this is perfect for people who want their kids to play a game, but might not hit the original asker's problem of restricting access to a single app (I mean it WILL do that but it'll also prevent it from doing ANYTHING else).

Not with public APIS (and hopefully, not with private ones). Even if you manage it somehow, Apple will reject it for breaking UI guidelines. Moreover, even if they didn't, people could always use the iPhone's "Force Quit" equivalent to hard terminate your app.

Apple is not going to approve this type of app, they state pretty explicitly that you're app needs to respond appropriately to springboard telling the app to terminate both when things like phone calls come in and when memory warnings come in.

This is not possible with the current SDK, nor do I suspect it will ever be.
You might be able to get this behaviour via jailbreaking, but you won't be able to sell your app through iTunes, nor will Apple ever approve such an application.

You can do it like this
Install the following mobileconfig file
This will disable the home button once you launch the app
Download
Found the link Here

Apple won't allow it.
What if something emergency happens and you wan to dial an emergency phone number. You are putting the user at risk. The trade-off isn't worth it.

Related

iOS 7 App Operations Running In Background; Saving a Video Recording In Background

I am currently trying to find the most efficient way to continue a method in the background of my app.
I am probably adding location/gps to my app soon, so I was considering using that flag to keep the app Active in the background. However, I do not want to add that flag yet because I want to post an App Update before I add the location functionality.
I know the exceptions;
Apps that play audible content to the user while in the background, such as a music player app
Apps that keep users informed of their location at all times, such as a navigation app
Apps that support Voice over Internet Protocol (VoIP)
Newsstand apps that need to download and process new content
Apps that receive regular updates from external accessories
Besides asking for a more generic idea then these ^, can someone explain the "external accessory" flag please? I am recording video from an outside device. However, I do not know what constitutes an "external accessory".
I also see that iOS7 has introduced new Multi-tasking functionality but I haven't seen any examples that I understand can someone also explain that? Maybe that is a viable solution?
Thanks in advance!

Long-running task performed in foreground is suspended when app enters background

When a user first opens my app, I need to download and install some content from a server before they can begin using the app. The problem is that this takes around 5 minutes on wifi, during which time the app goes into the background and the download is suspended.
Is there any way to either:
prevent an iOS app from entering the background whilst I perform my download
or continue peforming the task in the background (i.e. perform the task irrespective of whether the app is in the foreground or background)
Thanks
It really doesn't matter, if the user presses the home button it will go to background. Although you can do two things to mitigate the problem:
Use beginBackgroundTaskWithExpirationHandler, to give you a bit more time to download. Which you can read here.
Don't allow the device to become iddle, with [UIApplication sharedApplication].idleTimerDisabled = YES;. You can read more about that here.
Either way, the best thing you can do is to tell the user, that is an important download and he shouldn't quit the application.
Can't you include some or all of the content in your app bundle instead, and just download changes on first run?
I can't imagine this is a good first user experience, and it may not pass App Store review like this.
The only third party apps that are allowed to download in the background are newsstand apps loading issue content, and Apple are pretty strict about what they allow as newsstand apps.
You can't do what you want, in this situation. One way, and I think the best and only, is to resume your download when you app becomes active (returns to foreground state). Also, don't forget to register for connectivity notifications (Reachability class can be used for this purpose from this Apple sample app http://developer.apple.com/library/ios/#samplecode/Reachability/Introduction/Intro.html). Good Luck!

block ipad camera

Is there any way in which the usage of the camera of the iPad2 can be restricted only to my application? even if it is using i tunes.
could not find any code related to it. some code would be helpful.
There's no way to achieve this. I think it could be done with quite a bunch of hacking if you were developing for Cydia, but I'm not sure ever then. If the user quits your application or switches from it, the system will make the camera available to any other app requesting it.

Game Center for my iPhone Game

I am developing an iPhone game, and I will implement Game Center in it.
Apparently, I need to do some configuration with my application in iTunes Connect first. Therefore I have to "create" my application in the iTunes Connect page, right? But, how do I do that without getting Apple's staff review my app since I am still working on it?
I tried making a new app like normal, but it asks me for a bunch of stuff like screenshots etc, but I have none to offer in the first place...
Fixed. It seems they won't even review it if there is no binary uploaded yet.

Display an alert over the lock screen?

On the iPhone, when your phone is locked and screen off, if a SMS message comes in, the screen turns on and an alert shows up.
Currently I am using UIAlertView to create the alert dialog (with 2 buttons).
If the phone is off/locked, nothing shows up until I turn it back on and unlock it.
Is there any way to simulate the 'SMS preview' behavior, possibly with another class, and hopefully still allow the user to interact with the buttons there?
CFUserNotificationCreate is your friend.
Not in the official iPhone SDK? Too bad, I remember that a year ago on the big presentation of the yet-to-come SDK, an Apple evangelist/chief saying that the SDK would include exactly the same API as used internally by Apple... Pfff...
/John
What you want to do is not currently supported by the SDK. You should file a request with Apple.