core-telephony

Detect if iPhone is in Airplane mode?

左心房为你撑大大i 提交于 2019-11-27 07:10:36
问题 I need a way to detect if the iPhone is in Airplane Mode or not, I did some research and found: iphone how to check the Airplane mode? Which does not work, also I know I can set SBUsersNetwork to show an alert when in airplane mode, but it will ask user to switch on WIFI but my app need user to use 3G and WIFI simply does not work, so is there any straight forward way, in CoreTelephony that I can do my job? Thanks! 回答1: Basically: no. You cannot do this. What you can do is use the

CallStateDisconnected only detected for incoming calls, not for calls made from my app

試著忘記壹切 提交于 2019-11-27 05:54:38
问题 I can't detect end of call (state CallStateDisconnected), if I make call from my app. But if I receive call when my app is active, I can detect that state. I also receive state CTCallStateDialing twice or 3 times when call starts from my app. It used to be working under iOS5, this problems occured with iOS6. My app del code; self.callCenter = [[CTCallCenter alloc] init]; self.callCenter.callEventHandler = ^(CTCall* call) { // anounce that we've had a state change in our call center

Is it possible to determine if the SIM/Phone number has changed?

点点圈 提交于 2019-11-27 05:38:31
问题 We have a product where the user registers by providing their phone number. However after they register they could potentially change their sim. Is it possible to programatically determine if the sim has been removed or inserted? (Thanks if you provide it, but any digression comments on the use of using the phone number in the first place would be irrelevant to this discussion, I don't want to discuss that aspect of things, only the sim aspect). 回答1: Yes, of course it is possible. Link

Intercepting phone call - iPhone (correct method to hook in CoreTelephony)

时光毁灭记忆、已成空白 提交于 2019-11-27 04:05:08
问题 I am new to the jailbreak tweak development scene. I am trying to figure out the appropriate method to 'hook' so I can intercept an incoming call (and then run some code). I have dumped the header files of CoreTelephony framework however no methods seem obvious to hook. I have tried: - (void)broadcastCallStateChangesIfNeededWithFailureLogMessage:(id)arg1; - (BOOL)setUpServerConnection; but neither have worked. By worked I mean - get called when the iPhone receives a call. Any pointers as to

iOS 7: How to get own number via private API?

ぃ、小莉子 提交于 2019-11-27 04:00:56
Old ways don't work any more: // way 1 void *lib = dlopen("/Symbols/System/Library/Framework/CoreTelephony.framework/CoreTelephony", RTLD_LAZY); NSString* (*getPhoneNumber)() = dlsym(lib, "CTSettingCopyMyPhoneNumber"); if (getPhoneNumber == nil) { NSLog(@"getPhoneNumber is nil"); return nil; } NSString* ownPhoneNumber = getPhoneNumber(); // way 2 extern NSString* CTSettingCopyMyPhoneNumber(); NSString *phone = CTSettingCopyMyPhoneNumber(); Related questions: Is it possible to detect a phone number of the device in iOS? [UPDATE] Provided method works on iOS 6.1.4 without JB and iOS 7.1.2 with

How can I use private APIs to block incoming calls in an iOS application?

删除回忆录丶 提交于 2019-11-27 00:52:01
I would like to be able to selectively block incoming calls in an iOS application I'm writing. This is intended for personal use, not the App Store, so I'm fine with using private APIs to accomplish this. I have recently come across the Core Telephony framework. Is there a way to use this framework to block calls? If not, what private APIs could I use to do this? Are you sure it does not? code examples on http://tech.ruimaninfo.com/?p=83 shows how to do such things. Core Telephony headers in SDK are not complete. Of course this means no app store this is my code fragment based on example I

How to get a call event using CTCallCenter:setCallEventHandler: that occurred while the app was suspended?

旧城冷巷雨未停 提交于 2019-11-27 00:40:57
The documentation for CTCallCenter:setCallEventHandler: states that: However, call events can also take place while your application is suspended. While it is suspended, your application does not receive call events. When your application resumes the active state, it receives a single call event for each call that changed state The part relevant to this question is When your application resumes the active state, it receives a single call event for each call that changed state Implying the app will receive a call event for a call that took place in the past while the app was suspended. And this

Detecting call state in iOS4

大兔子大兔子 提交于 2019-11-26 22:02:55
I would like to know if there is a possibility to detect if the user is in call from an application that is currently in background. Or, receive a notification when the call is ended if the call was initiated from my app. Or, even more than that - is there a possibility to detect which app is in foreground? I don't believe that this is possible but I had to try... ;-) Any info will be appreciated. Thank you. In CTCallCenter , there is a method, callEventHandler that you can pass a block that will get called when call events happen. In this block, you'll be passed a CTCall object, and can get

Get CellID, MCC, MNC, LAC, Signal strength, quality and Network in iOS 8.3

帅比萌擦擦* 提交于 2019-11-26 20:33:34
问题 How to get cell id using private apis in ios 8.3 as previous core telephony private apis are not working in latest ios sdk 8.3. 回答1: You can still use this. It's working on iOS 8.3. I don't know how to get signal strength. Apple has changed many things in Core Telephony lately. :( CTTelephonyNetworkInfo *telephonyInfo = [CTTelephonyNetworkInfo new]; NSString *carrierNetwork = telephonyInfo.currentRadioAccessTechnology; NSLog(@"Mobile Network): %@", carrierNetwork); CTCarrier *carrier =

Get the callers phone number from an incoming call on iPhone

帅比萌擦擦* 提交于 2019-11-26 20:29:20
问题 I'm trying to get caller ID (phone number) at the time of incoming call. TrueCaller has implemented this and they get the phone number of incoming caller. I've found this information: 1. CoreTelephony Framework(It gives only calling states) 2. Apple's 9.0 update : "Maybe" contacts sync. with mail app and detects the incoming phone number. 回答1: ###EDIT### iOS 10 and above: Use Callkit, take a look at call directory extension According to documentation, Identifying Incoming Callers When a phone