• <i id='0DBoL'><tr id='0DBoL'><dt id='0DBoL'><q id='0DBoL'><span id='0DBoL'><b id='0DBoL'><form id='0DBoL'><ins id='0DBoL'></ins><ul id='0DBoL'></ul><sub id='0DBoL'></sub></form><legend id='0DBoL'></legend><bdo id='0DBoL'><pre id='0DBoL'><center id='0DBoL'></center></pre></bdo></b><th id='0DBoL'></th></span></q></dt></tr></i><div id='0DBoL'><tfoot id='0DBoL'></tfoot><dl id='0DBoL'><fieldset id='0DBoL'></fieldset></dl></div>
  • <legend id='0DBoL'><style id='0DBoL'><dir id='0DBoL'><q id='0DBoL'></q></dir></style></legend>

  • <small id='0DBoL'></small><noframes id='0DBoL'>

    <tfoot id='0DBoL'></tfoot>

        <bdo id='0DBoL'></bdo><ul id='0DBoL'></ul>

        Core Telephony 框架在 4.0 中部分公开

        Core Telephony framework partially public in 4.0(Core Telephony 框架在 4.0 中部分公开)

        <small id='E3DBx'></small><noframes id='E3DBx'>

          <legend id='E3DBx'><style id='E3DBx'><dir id='E3DBx'><q id='E3DBx'></q></dir></style></legend>

                  <tbody id='E3DBx'></tbody>
              • <tfoot id='E3DBx'></tfoot>
                  <bdo id='E3DBx'></bdo><ul id='E3DBx'></ul>

                  <i id='E3DBx'><tr id='E3DBx'><dt id='E3DBx'><q id='E3DBx'><span id='E3DBx'><b id='E3DBx'><form id='E3DBx'><ins id='E3DBx'></ins><ul id='E3DBx'></ul><sub id='E3DBx'></sub></form><legend id='E3DBx'></legend><bdo id='E3DBx'><pre id='E3DBx'><center id='E3DBx'></center></pre></bdo></b><th id='E3DBx'></th></span></q></dt></tr></i><div id='E3DBx'><tfoot id='E3DBx'></tfoot><dl id='E3DBx'><fieldset id='E3DBx'></fieldset></dl></div>
                  本文介绍了Core Telephony 框架在 4.0 中部分公开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  由于我不想越狱我的 iPhone,我正在开发一个需要访问 Core Telephony 框架的个人应用程序.

                  Since I don't want to jailbreak my iPhone i'm developing a personal application that needs to access the Core Telephony framework.

                  在 4.x Core Telephony 框架已部分公开,但其大部分未来仍处于隐藏状态并保持私有.

                  In 4.x Core Telephony framework has gone partially public but most of its futures are still hidden and kept private.

                  我已经下载了 seriot.ch 的头文件

                  I've joust downloaded the header files form seriot.ch

                  我找到了所有已知 CoreTelephony 函数的列表但我无法让我的代码做应该做的事情.有什么建议吗?

                  I've found a list of all the known CoreTelephony functions but i'm not able to make my code do what should be supposed to do. Some suggestion ?

                  在这些无用的情况下拒绝所有来电.

                  In these useless case refuse all incoming calls.

                  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {        
                  // Override point for customization after application launch.
                  [window makeKeyAndVisible]; 
                  CTCallCenter *callCenter = [[CTCallCenter alloc] init];    
                  callCenter.callEventHandler = ^(CTCall* call){
                     if (call.callState == CTCallStateIncoming) {         
                        CTCallDisconnect(call);
                     }
                  };  
                  return YES;
                  

                  }

                  推荐答案

                  您不能将公共 CoreTelephony 呼叫事件处理程序与 CTCallDisconnect 等私有 CoreTelephony 函数一起使用.您可以在此处查看所需私有事件处理程序代码的工作示例:http://tech.ruimaninfo.com/?p=83 - 它们是关键位:

                  You can't use the public CoreTelephony call events handler with the private CoreTelephony functions like CTCallDisconnect. You can see a working example of the required private event handler code here: http://tech.ruimaninfo.com/?p=83 - they key bits:

                  // Register our event handler
                  id ct = CTTelephonyCenterGetDefault();
                  CTTelephonyCenterAddObserver(ct, NULL, callback, NULL, NULL, CFNotificationSuspensionBehaviorHold);
                  
                  // Our callback
                  static void callback(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo)
                  {
                      NSString *notifyname=(NSString *)name;
                      if ([notifyname isEqualToString:@"kCTCallIdentificationChangeNotification"])
                      {
                          NSDictionary *info = (NSDictionary *)userInfo;
                          CTCall *call = (CTCall *)[info objectForKey:@"kCTCall"];
                          NSString *caller = CTCallCopyAddress(NULL, call);
                          NSLog(@"Incoming call: %@",caller);
                          CTCallDisconnect(call);
                      }
                   }
                  

                  我已经确认这适用于 iOS5.1

                  I've confirmed this working on iOS5.1

                  这篇关于Core Telephony 框架在 4.0 中部分公开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)
                  Cocos2d - How to check for Intersection between objects in different layers(Cocos2d - 如何检查不同层中对象之间的交集)
                  Highlight Read-Along Text (in a storybook type app for iPhone)(突出显示朗读文本(在 iPhone 的故事书类型应用程序中))
                  Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)
                  How to convert 32 bit PNG to RGB565?(如何将 32 位 PNG 转换为 RGB565?)
                  Proper cocos2d scene restart?(正确的 cocos2d 场景重启?)
                  <i id='ogcfF'><tr id='ogcfF'><dt id='ogcfF'><q id='ogcfF'><span id='ogcfF'><b id='ogcfF'><form id='ogcfF'><ins id='ogcfF'></ins><ul id='ogcfF'></ul><sub id='ogcfF'></sub></form><legend id='ogcfF'></legend><bdo id='ogcfF'><pre id='ogcfF'><center id='ogcfF'></center></pre></bdo></b><th id='ogcfF'></th></span></q></dt></tr></i><div id='ogcfF'><tfoot id='ogcfF'></tfoot><dl id='ogcfF'><fieldset id='ogcfF'></fieldset></dl></div>
                  • <bdo id='ogcfF'></bdo><ul id='ogcfF'></ul>
                    • <small id='ogcfF'></small><noframes id='ogcfF'>

                          • <tfoot id='ogcfF'></tfoot>
                              <tbody id='ogcfF'></tbody>
                            <legend id='ogcfF'><style id='ogcfF'><dir id='ogcfF'><q id='ogcfF'></q></dir></style></legend>