isSpotifyAppActive property

Future<bool> isSpotifyAppActive

Checks if the Spotify app is active on the user's device. You can use this to determine if maybe you should prompt the user to connect to Spotify (because you know they are already using Spotify if it is active). The Spotify app will be considered active if music is playing. Returns true if Spotify is active, otherwise false.

Throws a MissingPluginException if the method is not implemented on the native platforms.

Implementation

static Future<bool> get isSpotifyAppActive async {
  try {
    return await _channel.invokeMethod(MethodNames.isSpotifyAppActive);
  } on Exception catch (e) {
    _logException(MethodNames.isSpotifyAppActive, e);
    rethrow;
  }
}