after my hard times with Android notifications, where I need to do one method for android devices with Android 5.x and higher and another method for pre-Lollipop devices, I would advice you to search for additional libraries like this
SwitchButton
This project provides you a convenient way to use and customise a SwitchButton widget in Android. With just resources changed and attrs set, you can create a lifelike SwitchButton of Android 5.0+, iOS, MIUI, or Flyme and so on.
Now we get the biggest movement since SwitchButton published. v1.3.0 comes with totally reconsitution and more convenient API. A wholly new demo can give you a tour in it.

Github page: https://github.com/kyleduo/SwitchButton
More like this you would find here: http://android-arsenal.com/
Additional libraries may help you to avoid problems with backward compatibilities of Android components.
Like you said, you add this line of code:
android:thumb="@drawable/switch_selector"
and it works on Kitkat, but not on Lollipop.
I've found already that on Lollipop you may have much more to work.
Just take a look here: How to have a Lollipop switch button
So try to find your desired additional library like this above and let me know how it works ;-)
EDIT: To get API version use this:
Build.VERSION.RELEASE;
That will give you the actual numbers of your version; aka 2.3.3 or
2.2. The problem with using Build.VERSION.SDK_INT is if you have a rooted phone or custom rom, you could have a none standard OS (aka my
android is running 2.3.5) and that will return a null when using
Build.VERSION.SDK_INT so Build.VERSION.RELEASE will work no matter
what!
To use it, you could just do this;
String androidOS = Build.VERSION.RELEASE;
From: Retrieving Android API version programmatically