【问题标题】:iphone - start an application at the end of a phone calliphone - 在通话结束时启动应用程序
【发布时间】:2010-09-30 12:59:31
【问题描述】:

是否可以在通话结束或发送短信后启动应用程序?

【问题讨论】:

    标签: iphone


    【解决方案1】:

    NO 这根本不可能。因为通话结束或发送消息时您无法获取事件。所以你无法打开应用程序。

    快乐编码...

    【讨论】:

    • 下面的代码有效(它很丑,是的......) - 如果从 Web 视图调用调用,用户将返回到应用程序。
    【解决方案2】:

    我从 Apple 网站获得了这段代码,它运行良好:

    - (IBAction) dialNumber:(id)sender{
    
        NSString *aPhoneNo = [@"tel://" stringByAppendingString:[itsPhoneNoArray objectAtIndex:[sender tag]]] ;
        NSURL  *url= [NSURL URLWithString:aPhoneNo];
    
        NSString *osVersion = [[UIDevice currentDevice] systemVersion];
    
        if ([osVersion floatValue] >= 3.1) {
            UIWebView *webview = [[UIWebView alloc] initWithFrame:[UIScreen mainScreen].applicationFrame];
            [webview loadRequest:[NSURLRequest requestWithURL:url]];
            webview.hidden = YES;
            // Assume we are in a view controller and have access to self.view
            [self.view addSubview:webview];
            [webview release];
        }
        else {
            // On 3.0 and below, dial as usual
            [[UIApplication sharedApplication] openURL: url];          
        }
    
        //[[UIApplication sharedApplication] openURL:[NSURL URLWithString:aPhoneNo]];
    
    }
    

    【讨论】:

      【解决方案3】:

      看起来可能会有所帮助..

      iPhone SDK: Launching an app after call ends

      【讨论】:

        猜你喜欢
        • 2011-01-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-10-29
        • 1970-01-01
        • 2022-01-19
        相关资源
        最近更新 更多