Disconnect call programmatically in iOS7 - iphone

I want to disconnect a phone call programatically in iOS7. I know we can programmatically handle the interruptions for Incoming calls, SMS etc. on iPhone (without Appstore).
I have to create a launch daemon to get notifications as CTCallCenter doesn't deliver the notifications to UIApplications in the background as explained by Nate in his Answer.
Nate's comments shows there is some scope of disconnecting certain calls on an iPhone using the launch daemon (without Appstore).
So, My first question is it possible ? and if it is then How to do ?
Note : My App is not going to be on AppStore.

Hi it's not possible in iOS7. You need special entitlement so until there will be a jailbreak you are out of luck

Related

iphone: backgrounded app sync webservice

I know this question may be a little bit common and over asked but I cannot find any precise information... so :
Is it possible to have some kind of thread running when the app is in background so I can perform basic sync with my webservice ?
App is in background : I mean the user clicked the Home button, or switched to another app
basic sync : photo upload and download with AFNetworking. I know it has method to continue an HTTPRequest while app is in background, but this is not my point.
My goal would be to make some kind of sync manager, reading a list of photos to update created while the user was on the app, and perform those changes.
I know that the manager could be killed by the OS, but since my server uses atomic transfers it is not a problem. I just need a way to relaunch it... Push ?
I think apps like Google Latitude or Mail and those kind of apps uses what I am looking for but I cannot find any relevant details on it. And using iOS5 is not a problem but waiting for iOS6 would not be a solution.
Thank you for your replies !
PS : well I almost forgot. the app is designed for an enterprise program, so maybe rules are different ? I don't think there is any check for in-house deployment so it might lead to new possibilities...
Apple's Mail client has a background daemon which keeps it running but you can't have that with your own applications. Once an app enters a background state, it must halt it's operations. You can request for a little more time when backgrounded to finish off any transfers or writes to disk (see the Executing a Finite-Length Task in the Background section on Apple's Multitasking Guide)
Google Latitude has events generated based on location. This is a special type of backgrounding introduced by Apple for certain types of applications (see Implementing Long-Running Background Tasks section on Apple's Multitasking Guide) but this can't be used for HTTP syncing. It can only be used for audio, location, voip, newstand content, bluetooth and external hardware attachments.
Push doesn't seem like a solution because it only generates an alert. It doesn't trigger any action until the user triggers the opening of the notification.
You'll want to read Tech Note 2277 Networking and Multitasking.
Basically you have a couple of options:
If you can convince Apple that your app is a VoIP app then you can register a VoIP socket and the OS will resume your background app whenever there is activity on that socket.
Your main option though is to register a background task for any outstanding activity that you have to do when your app is put in the background. You typically get 10 minutes to finish up that work.
Mail is a special app with privileges you don't get.
Apps like Latitude typically register themselves for location updates, specifically to be woken up when there are major geo-position changes. Apps that record GPS tracks do similar things.
Found it !
Using Suhail Patel 's link on Apple's Multitasking Guide I added the voip tag to UIBackgroundModes in Info.plist and use setKeepAliveTimeout:handler: method of UIApplication to relaunch it if needed once the app is going to sleep.
I hope this will help a lot of you !
Of course this app won't be allowed to be on the App Store but for in house development this is in my opinion the best way to do so.
Thanks everyone for showing me the right direction !

Incoming call wakes iOS background App?

is it possible to wake an App in the background up, when a call comes in, and access CoreTelephony to send some infos over the web?
I'm practically a n00b in iOS development right now, but got asked a question if iOS is capable to do this. I searched in the iOS reference too, but with no luck.
It would be great if someone with more experience could answer it. Thanks a lot!
Steno
Please, have a look at the document about executing code in the background.
If you go to section "Implementing a VoIP Application", you will see that it is actually possible for your app to be awaken periodically so that it can check if it has anything to do (in your case, if I understand you correctly you would use CTCall to check for calling state).
So, basically, when awaken, your app could check for any incoming call and then use Core Telephony, as you say.
The only trouble about this is that if your app cannot be considered to a a VOIP app, Apple will not let it into the App Store.
It is not possible to have your code run when a call is received.

Device auto-lock

I have an application in which I want to lock the iPhone programmatically so that the user can't perform any action.
How can I determine the user is not working with the iPhone for some period, and after that period automatically lock the phone?
Such applications are used in all phone devices, where the user can set an auto-lock time and then the device will automatically lock if the user does not handle the device.
How is it done programmatically? Please give me one example of the code so I can perform this easily.
I am new to iPhone programming, and I am struggling in my application. Help me. Thanks in advance.
(For your lock the iphone device through programatic only )
Impossible.
But , you could prevent your phone from locking when your app is running.
[UIApplication sharedApplication].idleTimerDisabled = YES
There is no way to disable the Home Button in iOS using the documented API. The user will always be able to get back to the home screen or close your application using the Home Button.
Even if you find a way do it (which is very unlikely) your app will be definitely rejected from the App Store for a blatant violation of the iOS Human Interface Guidelines. If I were you I would reconsider implementing this behaviour, frankly, it's just not a good idea.
If you're only looking for blocking the the UI of your app, check out the answers to this question, more specifically, check out the incredibly useful MBProgressHUD library:

iPhone answering machine

Is it possible to create an iPhone application to answer incoming voice calls and play audio files back to the caller? If yes, before answering the call, is it possible to determine the caller id?
Thanks!
This is not possible using the SDK. You can most likely do it with a jailbroken app.
iPhone applications (non-jailbreak apps, at least) cannot intercept phone calls. When a phone call is initiated, your app is paused and cannot execute any commands.
Essentially, count on never being able to prevent basic functionality of the iPhone. You can't override texting behaviour, Mail.app behaviour, Safari behavior, etc. because Apple wants the user experience to be consistent (not to mention security issues in allowing an app to answer calls on someone's behalf).

Possible to hook into the phone calling functions with current iPhone SDK?

I've heard it mentioned elsewhere, one cannot programmatically hook into the phone call area of an iPhone using the current SDK. I'm looking to learn iPhone development and Obj C, with the end goal of creating a call timer app that runs in the background and alerts the user when a call has gone on too long.
Is it even possible to hook into methods liek that?
No. Your app will be interrupted when the user receives a call, and your code will not be allowed to run while the user is on the call. Additionally, there are no background apps allowed for the iphone. The best you can get is push notification, but you can't create a daemon or anything like that.
This information is provided in the iPhone Application Programming Guide
With version 4 you can now multitask to some degree.