首页 > 其他 > 详细

0917-发现voip会被拒

时间:2015-09-17 11:23:26      阅读:271      评论:0      收藏:0      [点我收藏+]

 

非常失望,音乐试了,viop试了,但是据说都会被拒。

 

- (void)applicationDidEnterBackground:(UIApplication *)application {

    

//    NSLog(@"进入后台");

//    [application beginBackgroundTaskWithExpirationHandler:nil];

    BOOL backgroundAccepted = [[UIApplication sharedApplication] setKeepAliveTimeout:600 handler:^{ [self backgroundHandler]; }];

    

    if (backgroundAccepted)

        

    {

        

        NSLog(@"backgrounding accepted");

        

    }

    

    

    

    [self backgroundHandler];

   

    

}

static int counter = 0;

 

- (void)backgroundHandler {

    

    

    

    NSLog(@"### -->backgroundinghandler");

    

    

    

    UIApplication *app = [UIApplication sharedApplication];

    

    

    

  __block UIBackgroundTaskIdentifier bgTask = [app beginBackgroundTaskWithExpirationHandler:^{

        

        [app endBackgroundTask:bgTask];

        

        bgTask = UIBackgroundTaskInvalid;

        

    }];

    

    

    

    // Start the long-running task

    

    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

        

        

        

        while (1) {

            

            NSLog(@"counter:%ld", counter++);

            

            sleep(1);

            

        }  

        

    });

 

0917-发现voip会被拒

原文:http://www.cnblogs.com/yintingting/p/4815628.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!