5

We are working on an VoIP application, when my application goes background, I have been trying to use the setKeepAliveTimeout:handler: to keep the connection alive. As per the apple documentation, they asks to give minimum 600 seconds as timeout. Actually we are maintaining less timeout value, is it possible to handle with less time out?

And if the time out hits, how to use the handler to reset the timer or request more time so that I can keep my connection alway alive (to receive incoming calls)?

Here is what I am doing...

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

    BOOL backgroundAccepted = [[UIApplication sharedApplication] setKeepAliveTimeout:600 handler:^{ [self backgroundHandler]; }];
    if (backgroundAccepted)
    {
        NSLog(@"VOIP backgrounding accepted");
    }
}




- (void)backgroundHandler {

    NSLog(@"### -->VOIP backgrounding callback"); // What to do here to extend timeout?
}
4

1 に答える 1

2

Appleのドキュメントから:

The minimum acceptable timeout value is 600 seconds.

あなたのコメントに関する編集

VoIP 接続は (ほぼ) 通常の接続です。つまり、着信データがある場合、アプリはバックグラウンドで実行を再開します。タイムアウト ハンドラは、タイムアウトを回避するために相手側に ping を送信する場合に使用します。もう少し詳しい情報は TN 2277です。

于 2013-02-25T09:59:30.137 に答える