AbstractSpotifyBroadcastReceiver

abstract class AbstractSpotifyBroadcastReceiver : BroadcastReceiver

If you are developing an Android application and want to know what is happening in the Spotify app, you can subscribe to broadcast notifications from it. The Spotify app can posts sticky media broadcast notifications that can be read by any app on the same Android device. The media notifications contain information about what is currently being played in the Spotify App, as well as the playback position and the playback status of the app.

Note that media notifications need to be enabled manually in the Spotify app

You need to extend this class and register it, whether through the manifest or fragment/activity to receive notifications, as well as overriding onPlaybackStateChanged, onQueueChanged, and/or onMetadataChanged.

Constructors

AbstractSpotifyBroadcastReceiver
Link copied to clipboard
fun AbstractSpotifyBroadcastReceiver()

Types

Companion
Link copied to clipboard
object Companion

Functions

abortBroadcast
Link copied to clipboard
fun abortBroadcast()
clearAbortBroadcast
Link copied to clipboard
fun clearAbortBroadcast()
getAbortBroadcast
Link copied to clipboard
fun getAbortBroadcast(): Boolean
getDebugUnregister
Link copied to clipboard
fun getDebugUnregister(): Boolean
getResultCode
Link copied to clipboard
fun getResultCode(): Int
getResultData
Link copied to clipboard
fun getResultData(): String
getResultExtras
Link copied to clipboard
fun getResultExtras(p0: Boolean): Bundle
goAsync
Link copied to clipboard
fun goAsync(): BroadcastReceiver.PendingResult
isInitialStickyBroadcast
Link copied to clipboard
fun isInitialStickyBroadcast(): Boolean
isOrderedBroadcast
Link copied to clipboard
fun isOrderedBroadcast(): Boolean
onMetadataChanged
Link copied to clipboard
open fun onMetadataChanged(data: SpotifyMetadataChangedData)
A metadata change intent is sent when a new track starts playing.
onPlaybackStateChanged
Link copied to clipboard
open fun onPlaybackStateChanged(data: SpotifyPlaybackStateChangedData)
A playback state change is sent whenever the user presses play/pause, or when seeking the track position.
onQueueChanged
Link copied to clipboard
open fun onQueueChanged(data: SpotifyQueueChangedData)
A queue change is sent whenever the play queue is changed.
onReceive
Link copied to clipboard
open override fun onReceive(context: Context, intent: Intent)
peekService
Link copied to clipboard
open fun peekService(p0: Context, p1: Intent): IBinder
setDebugUnregister
Link copied to clipboard
fun setDebugUnregister(p0: Boolean)
setOrderedHint
Link copied to clipboard
fun setOrderedHint(p0: Boolean)
setResult
Link copied to clipboard
fun setResult(p0: Int, p1: String, p2: Bundle)
setResultCode
Link copied to clipboard
fun setResultCode(p0: Int)
setResultData
Link copied to clipboard
fun setResultData(p0: String)
setResultExtras
Link copied to clipboard
fun setResultExtras(p0: Bundle)

Sources

android source
Link copied to clipboard