Hello,
In an iPhone app where I want to keep track of the plug-unplug of the earphone I use the classical code:
Well, though it works most of the time; I now find myself in a situation where handleRouteChangeCallBack gets called for no apparent reason that I can see.
Normally it should fire up only when I plug in or out an earphone (or maybe a headset).
Has anyone had this kind of experience? Or has anybody an idea of the issue? I can't see what I am missing.
Thanks for any help.
P.S.
I am using XCode 5 and experimenting on iOS 7.
In an iPhone app where I want to keep track of the plug-unplug of the earphone I use the classical code:
Code:
routeChangeID=kAudioSessionProperty_AudioRouteChange;
AudioSessionAddPropertyListener(routeChangeID,handleRouteChangeCallBack,(__bridge void *)(self));
Well, though it works most of the time; I now find myself in a situation where handleRouteChangeCallBack gets called for no apparent reason that I can see.
Normally it should fire up only when I plug in or out an earphone (or maybe a headset).
Has anyone had this kind of experience? Or has anybody an idea of the issue? I can't see what I am missing.
Thanks for any help.
P.S.
I am using XCode 5 and experimenting on iOS 7.
Last edited by a moderator: