I have the same query.
I love my Bose MIE2i headset with three buttons and in-line mic.
On Android I use an app called headset button controller and it lets me specify which application should be launched when I press play so I can set it to control spotify.
On my Macbook Pro it will always launch itunes. Even if I have spotify open and in focus, it will launch itunes.
The Macbook play/pause button on the F8 key will at least control spotify when I have it open already. But when spotify is not running, it will also launch itunes.