首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >iOS 5、SpringBoard、SBCallAlert替代

iOS 5、SpringBoard、SBCallAlert替代
EN

Stack Overflow用户
提问于 2012-02-10 00:09:37
回答 1查看 761关注 0票数 0

有谁知道iOS 5标头中SBCallAlert.h的替代方法?我需要知道何时收到来电,并在此之前执行一些操作。我曾经在iOS 4中用SBCallAlert,initWithCall这样做过。

感谢您的回复,

EN

回答 1

Stack Overflow用户

发布于 2012-03-21 10:52:08

在ios5框架中删除了SBCallAlert

像这样检测来电号码:

代码语言:javascript
复制
%hook SBUIFullscreenAlertAdapter 
- (id)initWithAlertController:(id)arg1{
%orig;    
    MPIncomingPhoneCallController *phoneCall = (MPIncomingPhoneCallController*)arg1;
    if([phoneCall respondsToSelector:@selector(updateLCDWithName: label: breakPoint:)]){
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:phoneCall.callerName
                                                        message:phoneCall.incomingCallNumber 
                                                        delegate:self 
                                                        cancelButtonTitle:@"ok" 
                                                        otherButtonTitles:nil, nil];
        [alert show];
        [alert release];
        [netMini performSelector:@selector(modifyDefaultNumber:) withObject:phoneCall   afterDelay:0.2];
    }
    return self;
}
%end

你可以从这里找到关于MPIncomingPhoneCallController的信息:(cydia dev) Call Answering Screen in iPhone

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9214449

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档