Newer versions of MacOS
The following script has been developed by Dylan Gattery
# "Usernoted" seems to be the "user notifications daemon", so get it's PID.
pid=$(ps -A | grep -m1 usernoted | awk '{print $1}')
# Find the sqlite3 database that this program has open. It's in a "private" folder (app sandboxing).
db="$(lsof -p $pid | grep 'com.apple.notificationcenter/db2/db$' | awk '{print $9}')"
# I got the bundleid from Spotify.app/Contents/Info.plist
bundleid="com.spotify.client"
# This is the database modification to make.
sql="INSERT INTO app (identifier, badge) VALUES ( '$bundleid', 0 );"
# Run the command
sqlite3 "$db" "$sql"
# Restart Dock and usernoted to make the changes take effect
killall usernoted
killall Dock
This should cause the badge to immediately disappear, and the program should be listed in the system preferences pane.
Original answer (tested on Yosemite)
I have a solution that I was able to reverse engineer. I've tested it on my machine, running Yosemite 10.10.4 (14E46). If you can find the bundle ID (in the Info.plist file for the app bundle), you can use this script to force the app to appear in the notifications preferences pane.
# "Usernoted" seems to be the "user notifications daemon", so get it's PID.
pid=$(ps aux | grep -i [u]sernoted | awk '{print $2}')
# Find the sqlite3 database that this program has open. It's in a "private" folder (app sandboxing).
db="$(lsof -p $pid | grep com.apple.notificationcenter/db/db\$ | awk '{print $9}')"
# I got the bundleid from Spotify.app/Contents/Info.plist
bundleid="com.spotify.client"
# I use 0 as the flags because you can change all the settings in System Preferences
# 5 seems to be the default for show_count
# Grab the next-highest sort order
sql="INSERT INTO app_info (bundleid, flags, show_count, sort_order) VALUES ( '$bundleid', 0, 5, (SELECT MAX(sort_order) + 1 FROM app_info) );"
# Run the command
sqlite3 "$db" "$sql"
# Restart usernoted to make the changes take effect
killall usernoted
At this point you can open System Preferences -> Notifications, and you will find the app that you just added at the bottom of the list. You can enable / disable badging the icon from this page.