Package com.adamratzman.spotify.notifications

Types

AbstractSpotifyBroadcastReceiver
Link copied to clipboard
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.
SpotifyBroadcastEventData
Link copied to clipboard
abstract class SpotifyBroadcastEventData(type: SpotifyBroadcastType)
Data from a broadcast event
SpotifyBroadcastType
Link copied to clipboard
enum SpotifyBroadcastType : Enum<SpotifyBroadcastType>
Broadcast receiver types.
SpotifyMetadataChangedData
Link copied to clipboard
data class SpotifyMetadataChangedData(playableUri: PlayableUri, artistName: String, albumName: String, trackName: String, trackLengthInSec: Int, timeSentInMs: Long) : SpotifyBroadcastEventData
A metadata change intent is sent when a new track starts playing.
SpotifyPlaybackStateChangedData
Link copied to clipboard
data class SpotifyPlaybackStateChangedData(playing: Boolean, positionInMs: Int, timeSentInMs: Long) : SpotifyBroadcastEventData
A playback state change is sent whenever the user presses play/pause, or when seeking the track position.
SpotifyQueueChangedData
Link copied to clipboard
class SpotifyQueueChangedData(timeSentInMs: Long) : SpotifyBroadcastEventData
A queue change is sent whenever the play queue is changed.

Functions

registerSpotifyBroadcastReceiver
Link copied to clipboard
fun Context.registerSpotifyBroadcastReceiver(receiver: AbstractSpotifyBroadcastReceiver, vararg notificationTypes: SpotifyBroadcastType)
Register a Spotify broadcast receiver (receiving notifications from the Spotify app) for the specified notification types.