core-telephony

Call events in iPhone

为君一笑 提交于 2019-12-22 01:31:42
问题 I am trying to get Call events (call received, call ended etc) I tried to run sample code of CoreTelephonyDemo, but I am not getting any call events. Can anybody guide me for the same. I tried this code in applicationWillResignActive but I am not getting any events. Am I missing anything or doing anything wrong? Please guide . - (void)applicationWillResignActive:(UIApplication *)application { CTCallCenter *callCenter1 = [[CTCallCenter alloc] init]; callCenter1.callEventHandler=^(CTCall* call)

How to get Mobile Country and Network code on an iPhone

北城余情 提交于 2019-12-21 04:21:46
问题 Is there any way of getting the mnc and mcc numbers on an iPhone? 回答1: You need the CoreTelephony framework CTTelephonyNetworkInfo *networkInfo = [[CTTelephonyNetworkInfo alloc] init]; CTCarrier *carrier = [networkInfo subscriberCellularProvider]; to get MNC, NSString *mnc = [carrier mobileNetworkCode]; to get MCC, NSString *mcc = [carrier mobileCountryCode]; 回答2: You can use the methods of the CTCarrier class to retrieve Country and network code. However this is only for the home provider (

iOS I can't get my carrier name

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-20 14:38:36
问题 as explained here -> Retrieving Carrier Name from iPhone Programmatically i'm trying to get my carrier's name, i'm using this code CTTelephonyNetworkInfo *netinfo = [[CTTelephonyNetworkInfo alloc] init]; CTCarrier *carrier = [netinfo subscriberCellularProvider]; NSLog(@"Carrier Name: %@", [carrier carrierName]); [netinfo release]; but i receive a warning on [carrier carrierName] : Instance method '-carrierName' not found i've added and the framework coretelephony to my project but when i

Detecting GSM Call States in IOS 10 (Swift 3, Xcode 8) and Notification from Background state

梦想的初衷 提交于 2019-12-20 12:38:27
问题 TLDR: Detect call end event from background Please see update to the question below: Is it possible to detect/get an event for call state in IOS 10 using Swift from background state . In the earlier versions there was a CORE Telephony api but this seems to be deprecated now. I have seen the CallKit Api but it says that it is for VOIP based calls. I need to get the state of normal CDMA/GSM calls, not VOIP based calls and when the call ends just fire a notification to server. I do not need to

iPhone, call another phone number in response to the first not answering?

久未见 提交于 2019-12-20 09:52:02
问题 I am attempting to create an application that will initiate a call to a priority 1 contact on a call-center-like list. Then, if that contact does not answer (let's forget the whole problem of answering machines here), I'd like to call the priority 2 contact, and so on, until one of them answers or I exhaust my list. Is this possible? I've tried the following: Hook into the CTCallCenter.CallEventHandler event, and checking the call state for CTCallStateConnected and CTCallStateDisconnected ,

How to get own mobile number from the iOS Device programmatically? [duplicate]

别等时光非礼了梦想. 提交于 2019-12-18 17:43:08
问题 This question already has answers here : Programmatically get own phone number in iOS (9 answers) Closed 3 years ago . I want to get my own contact number for my app. I have read some answers on the stack overflow but those were old. So please let me know according to new guidelines of Apple, can we get mobile number? 回答1: The phone number is not accessible from any Apple public API which means you can't get it. 回答2: The mobile number cannot be accessed without using any private API using

Getting wrong carrier name in IOS

寵の児 提交于 2019-12-18 16:52:08
问题 I am working on an IOS application.My requirement is to get the mobile carrier name.I used the following code. In .h #import <CoreTelephony/CTTelephonyNetworkInfo.h> #import <CoreTelephony/CTCarrier.h> In .m CTTelephonyNetworkInfo *netinfo = [[CTTelephonyNetworkInfo alloc] init]; CTCarrier *carrier = [netinfo subscriberCellularProvider]; NSLog(@"Carrier Name: %@", [carrier carrierName]); Here in Log its printing "Carrier" I googled and found this link.But as per its answer my device is still

Possible way to detect sim card detection in ios?

前提是你 提交于 2019-12-18 13:23:03
问题 I have a iphone app that has the capability to send messages. I want to alert user when sim card is not available in iphone. So i tried below three function to check sim card availabilty Class messageClass = (NSClassFromString(@"MFMessageComposeViewController")); if([messageClass canSendText]){ // Sim available NSLog(@"Sim available"); } else{ //Sim not available NSLog(@"Sim not available"); } if([MFMessageComposeViewController canSendText]){ // Sim available NSLog(@"Sim available"); } else{

CoreTelephony crash

冷暖自知 提交于 2019-12-18 11:42:20
问题 I am receiving this backtrace from TestFlight regarding one interesting crash. As far as I understood, the application crashes at some point, when using CoreTelephony . Can this be possible of someone "calling" while the user is using the application? To my knowledge, the application is not using the CoreTelephony Framework . The Exception reason is SIGSEGV and the crash thread is 0 Thank You! PRIMARY THREAD THREAD 0 0 GPIreland 0x00113a1a testflight_backtrace + 238 1 GPIreland 0x00114704

How to detect call incoming programmatically

懵懂的女人 提交于 2019-12-17 18:07:34
问题 I need my app to send a notification when there is a call (incoming call, connected, call ended) I registered my viewController with notification. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(callReceived:) name:CTCallStateIncoming object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(callEnded:) name:CTCallStateDisconnected object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(callConnected:) name