I am working on a voice recording app wherein there could be interruption by phone calls, text messages, and/or system alerts. As for phone calls, I realize the recording has to be stopped and have worked this out successfully. My challenge seems to be with other alerts such as low-battery status, alarms, text messages, etc. For now, I have managed to pause and save recording as soon as an alert interrupt pops up, but am looking at more efficient options.
In most real-world scenarios on ad-hoc distribution mode, I notice that my users do not even monitor the iPhone or iPod screen when recording their voices. Also, in case we test this app on the iPod Touch, then the sounds for the alerts are pretty feeble and they miss out on the alerts and continue recording only to realize after a few minutes or maybe at the end of the session that the recording was interrupted.
Here are my questions:
Any help would be greatly appreciated. Any other idea to handle this situation is most welcome.
You could try to implement application delegate methods
-(void)applicationWillResignActive:(UIApplication *)application{
[recorder playSound];
[recorder pause];
}
-(void)applicationDidBecomeActive:(UIApplication *)application{
[recorder record];
}
Put those methods in the appDelegate class.
If you want to implement your own alert do it in the applicationWIllResignActive, but I am not sure if you should do it, cause all the alerts like SMS, push notifications or battery warning trigger vibrations and sounds.