Since Call blocking feature has been introduced by apple in ios 7 , is there any way or API through which call blocking can be achieved programmatically ??
Related
Whats the correct approach for incoming calls on iOS. I use voip notification and e.g. when somebody is calling to me and I am not answering then after 30 sec I finish call and I send next voip notification (cancel notificaiton) to remove notification about call. The problem is that since iOS 13 we have to report all of voip notification. What should we do in this situation because I can't send voip notification (because I stop getting notification later due to apple politics) if somebody don't answer or when caller (outside of app) finish the call first then calle (app) have to get signal that call is terminated and to finish the call. How we should inform app that call is closed (if we answered or nope)? Maybe is there a way to report voip notification without opening callkit screen and terminating it automatically?
I think there are a couple of things that you can do here,
1/ I didn't understand why you are not able to use another VoIP to stop ringing, you should be able to do it. If there is already call kit presented in the system from your app you don't need to present another one, the system is smart enough to understand this and won't blacklist you. And in your case, since your phone is still ringing you should be able to send another VoIP without any problem, if this not working for you I suggest that, you should make sure you have an active call.
2/ You can create your own timeout mechanism, since app is awake and woke up with call kit OS won't terminate your app even if it is in background, so create your own GCD timeout or any other similar solution and use it.
3/ If you don't want to use VoIP at all, then you can use alert or background notifications however delivery is not guaranteed for these notifications, especially for background notifications.
Is there a way to block/filter the incoming calls in iphone 4.0+
I've found a lot of apps saying that they are for blocking the calls with a price in app store. But the reviews are negative. Is is really possible to block calls ? Can anyone advise me on this ?
Thanks a zillion :)
The Answer is NO With current SDK support you can not intercept/block calls sms.
This question already has an answer here:
Closed 11 years ago.
Possible Duplicate:
how can i terminate api call in iphone
hi friends,
I have an api call in my iphone app. That api call take more time for loading (near 100 sec). while the api processing, i hit the home button of my app. the app terminated. but the api call doesn't terminated.
how can I terminate api call.
Like e.James said, look at the UIApplicationDelegate protocol.
However, you might be more interested in either applicationDidEnterBackground: or
applicationWillTerminate: (depending on whether or not the device supports multitasking), because applicationWillResignActive: will also be called in cases like when the user receives a phone call, or other similar interruptions (see documentation).
Check out the UIApplicationDelegate protocol. You can cancel the API call in the applicationWillResignActive: method, which is called just before the app goes into background mode.
Seeing you duped the question, i'll post my answer here too:
I suppose you mean a web API call, like google's geoservices. To do this, you will need to make the call using a NSURLConnection. This way, you can cancel a call anytime using [connection cancel].
Try this tutorial. It's meant for a JSON api call. If you need another API, just start reading from 'fetching JSON over HTTP', there they set up a NSURLConnection. If you retain this connection until it's done, you will be able to make the [connection cancel] call at anytime.
Using the UIApplicationDelegate, you can detect the app entering the background.
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.
Is it possible to write an application that will block incoming and outcoming phone calls? Or is the iPhone locked down too much? Thanks!
EDIT: See Rajan Maheshwari's answer below. CallKit now provides this. Even things that seemed they would never change, can change eventually.
Anything that modifies a user's ability to make or receive phone calls is going to run afoul of Apple's basic approach to third-party apps. There are a lot of things that are questionable and you might get away with. Blocking calls is clearly forbidden.
It is now possible to detect and block unwanted phone calls from iOS 10 and above.
See the CallKit framework
The CallKit framework (CallKit.framework) lets VoIP apps integrate with the iPhone UI and give users a great experience. Use this framework to let users view and answer incoming VoIP calls on the lock screen and manage contacts from VoIP calls in the Phone app’s Favorites and Recents views.
CallKit also introduces app extensions that enable call blocking and caller identification. You can create an app extension that can associate a phone number with a name or tell the system when a number should be blocked.
A number of events will potentially interrupt an application - incoming call, SMS message or calendar alert. If the user ignores the interruption your application will continue running. If not, it will terminate.
See Apple docs for more details.
It is possible in iOS 10.
Here's how to do it ->
1.Create a call directory extension
2.Block the incoming call ->
class CustomCallDirectoryProvider: CXCallDirectoryProvider {
override func beginRequest(with context: CXCallDirectoryExtensionContext) {
let blockedPhoneNumbers: [CXCallDirectoryPhoneNumber] = [ phone Numbers here with country code! ]
for phoneNumber in blockedPhoneNumbers.sorted(by: <) {
context.addBlockingEntry(withNextSequentialPhoneNumber: phoneNumber)
}
context.completeRequest()
}
}
Note:
If you are using callKit to receive incoming calls then there is no need to manually block other calls.
Link -> https://developer.apple.com/reference/callkit
An app has not access to the phone feature, and has no way to block a call.
The alternative is to wait for Apple to offer that feature in the future.
In the meantime, you can
Ask your provider - some providers do that
Create a custom ring tone (silent) to be associated to some number (no ring).