문제

Is it possible for my app to "take over" when a system alert pops up? My app disables the idle timer, but when a system alert pops up, the alert seems be enabling the timer. What can I do about that?

도움이 되었습니까?

해결책

Are you trying to suppress the alerts? Then the answer is: you can't.

If you're trying to prevent the alerts from messing with your app's disabling of the idle timer, then I believe donkim is on the right trail.

다른 팁

Would it be possible for you to hook into one of the methods that gets called when your app goes in and out of the background? Say, one of these?

- (void)applicationWillResignActive:(UIApplication *)application {
NSLog(@"applicationWillResignActive");
}

- (void)applicationDidEnterBackground:(UIApplication *)application {
NSLog(@"applicationDidEnterBackground");
}

- (void)applicationWillEnterForeground:(UIApplication *)application {
NSLog(@"applicationWillEnterForeground");
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
NSLog(@"applicationDidBecomeActive");
}

I bet one of those gets called when that happens. You can probably disable the idle timer when your app gets the focus back.

EDIT: On re-reading the question, it looks like you're looking to suppress the alerts (i.e., not let them happen). Heh, I focused on the latter half of your question.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top