2012-07-03 3 views
0

내 앱이 백그라운드에서 계속 활성화되어있는 동안 (즉, 완전히 종료되지 않은 경우) 또는 전화 통화 후에 다시 시작되는 경우에 따라 다른 기능을 사용하고 싶습니다. 가능한?전화를 건 후 다시 시작한 앱과 시작 페이지에서 실행 한 앱을 구분하려면 어떻게해야합니까?

stackoverflow에서 찾은 답변은 대부분 전화 후에 다시 시작하는 방법과 관련이 있습니다.

편집 : 2008 년 12 월에 열린 사과 포럼에서이 질문에 대한 답변을 찾았습니다.이 답변은 평균 전화 통화 기간을 기준으로 공제하는 것이 가장 유효한 옵션 인 것처럼 보입니까? AppDelegate에에서

답변

1

두 앱에서 becalled 것입니다 방법을 실행하고있다 그리고 예를 들어 전화가 온다 :

- (void)applicationWillResignActive:(UIApplication *)application { 
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 
    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 
} 

그리고 당신은 응용 프로그램을 다시 활성화 될 때 호출된다.

- (void)applicationDidBecomeActive:(UIApplication *)application { 
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 
} 

당신이 응용 프로그램은 배경 또는 호출이 시작할 때 실행 아니었다면 전화가 제작 된 경우 알 수있는 방법 확인 없습니다.

+0

죄송합니다. '확실한 방법은 있습니다 ...'라는 말의 의미를 이해하지 못합니다. – Morgaine

+0

앱이 활성화되어 있지 않은 경우 전화가 왔는지 알 수 없습니다. – rckoenes

관련 문제