anon
anon

Reputation:

iPhone headphone click detection

I've tried looking through the documentation, but I can't seem to find (or recognize) what I'm looking for.

The iPhone and iPod Touch have a momentary switch on the headphones, which I believe is called the "remote" (please correct me if I'm wrong). It is used to start/stop/forward/back for music or to pickup/end a phone call. I'd like to know when this switch is clicked in my native application.

In which framework and classes would I find this?

Upvotes: 3

Views: 739

Answers (1)

Chris Gummer
Chris Gummer

Reputation: 4782

I don't believe this functionality is supported by any current framework.

If your application has iPod playback during execution you could register for MPMusicPlayerController notifications - Music Player Notifications

This will notify you of the playback state changes you mention above. However, it will not tell you whether the state was changed via the remote or the UI. But it's the only way that I know of to 'guess' if the remote button was clicked - I use this method in one of my own apps.

Upvotes: 1

Related Questions