core-telephony

Is there any way to determine if the iphone is roaming?

北城以北 提交于 2019-11-26 18:43:18
I am working on an iPhone application and would really like to determine if the device is roaming so that I can intelligently avoid costing my users expensive connections if out of their home network. The application I am writing is for jailbroken phones, however I would prefer to use standard SDKs if possible. Here is what I've already found: 1. Apple SDKs: In the apple documentation, I found the promise in Apple's SCNetworkReachability API. The API provides access to such things as whether you are on a WIFI or a cell phone network, whether a network connection is currently established, etc.

Retrieving Carrier Name from iPhone programmatically

浪子不回头ぞ 提交于 2019-11-26 17:15:53
Is there a way to know the cell carrier on an iPhone programmatically? I am looking for the carrier name which the iPhone is connected to. George Zhu In iOS 4, the CoreTelephony framework is useable, here's a snippet to get the carrier name: CTTelephonyNetworkInfo *netinfo = [[CTTelephonyNetworkInfo alloc] init]; CTCarrier *carrier = [netinfo subscriberCellularProvider]; NSLog(@"Carrier Name: %@", [carrier carrierName]); [netinfo release]; Link against CoreTelephony and include in your headers: #import <CoreTelephony/CTTelephonyNetworkInfo.h> #import <CoreTelephony/CTCarrier.h> Just to make a

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

你。 提交于 2019-11-26 12:25:26
问题 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? 回答1: Are you sure it does not? code examples on http://tech.ruimaninfo.com/?p=83 shows how to do such things. Core Telephony

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

非 Y 不嫁゛ 提交于 2019-11-26 10:59:22
问题 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

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

三世轮回 提交于 2019-11-26 09:28:48
问题 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

Detecting call state in iOS4

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-26 08:09:50
问题 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. 回答1: In CTCallCenter , there is a method, callEventHandler that you can pass a block

Retrieving Carrier Name from iPhone programmatically

佐手、 提交于 2019-11-26 06:05:12
问题 Is there a way to know the cell carrier on an iPhone programmatically? I am looking for the carrier name which the iPhone is connected to. 回答1: In iOS 4, the CoreTelephony framework is useable, here's a snippet to get the carrier name: CTTelephonyNetworkInfo *netinfo = [[CTTelephonyNetworkInfo alloc] init]; CTCarrier *carrier = [netinfo subscriberCellularProvider]; NSLog(@"Carrier Name: %@", [carrier carrierName]); [netinfo release]; Link against CoreTelephony and include in your headers: