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

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 linked if ([str1 isEqualToString:@”kCTCallIdentificationChangeNotification”]) { NSDictionary *info = (__bridge NSDictionary *)userInfo; CTCall2 *call = (__bridge … Read more

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

I’ve found a solution but I have no idea why it’s working. Only thing I can think of is a bug in GCD and/or CoreTelephony. Basically, I allocate two instances of CTCallCenter like this void (^block)(CTCall*) = ^(CTCall* call) { NSLog(@”%@”, call.callState); }; -(BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { callCenter1 = [[CTCallCenter alloc] init]; callCenter1.callEventHandler = block; callCenter2 … Read more

Detecting call state in iOS4

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 the callState. So, you can get a notification when a call is initiated or ended, and handle it appropriately. You can’t get … Read more

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

There is! It’s not documented at all, and I highly doubt this would work on a non-jailbroken phone (as it requires using files not in the sandbox). However, here is how it is done. The iPhone file system keeps two softlinks: static NSString *carrierPListSymLinkPath = @”/var/mobile/Library/Preferences/com.apple.carrier.plist”; static NSString *operatorPListSymLinkPath = @”/var/mobile/Library/Preferences/com.apple.operator.plist”; when these links are … Read more

Retrieving Carrier Name from iPhone programmatically

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>