Reputation: 352
I'm building an iOS/Android PhoneGap app - currently I'm focusing on the iOS build.
For iOS I'm using the the LowLatencyAudio plugin to play music in the background (I must use this plugin so that the music continues to play in between page loads).
When I receive a phone call, the music stops. However the problem that I am facing is that when the call is over, the app resumes but with no music.
I see the simplest solution would be to simply make the call to my LowLatencyAudio.play() function when the call is over. My first idea was to try and hook in to the resume event using:
document.addEventListener("resume", ...
However, this function doesn't get called after a phone call. Does anybody know what event I can listen for if there is one? And if there isn't - an alternative solution?
Upvotes: 3
Views: 1595
Reputation: 942
Try the "active" event that is mentioned in the iOS quirks in the Cordova docs: http://cordova.apache.org/docs/en/2.6.0/cordova_events_events.md.html#resume
Cordova is still under active development and they release breaking changes or functionality that does not always work on all devices quite frequently.
Upvotes: 2