One Logo Pool Ball
ShazamKit · IOS API REFERENCE

SHLibrary

class · iOS 17.0+ · SDK 27.1

final class SHLibrary

An object that represents a user's synced Shazam library.

Members (4)

method · iOS 17.0+

removeItems

TypeScript
removeItems(items: Array<SHMediaItem>): Promise<void>
Swift declaration
final func removeItems(_ items: [SHMediaItem]) async throws

Removes an array of media items from the user's Shazam library. Apps can only remove media items that it added to the library with ``SHLibrary/addItems(_:)``. This throws ``SHError/Code/mediaLibrarySyncFailed`` if the system can't remove at least one ``SHMediaItem`` or if an error occurred during the removal. In that case, the system doesn't remove any items from the library. - Parameters: - items: An array containing the ``SHMediaItem`` objects to remove from the library.

get · iOS 17.0+

items

TypeScript
get items(): Promise<Array<SHMediaItem>>
Swift declaration
@MainActor final var items: [SHMediaItem] { get }

The list of synced items in the Media Library.

get · iOS 17.0+

default

TypeScript
static get default(): SHLibrary
Swift declaration
static let `default`: SHLibrary

An instance of the default Shazam library.

method · iOS 17.0+

addItems

TypeScript
addItems(items: Array<SHMediaItem>): Promise<void>
Swift declaration
final func addItems(_ items: [SHMediaItem]) async throws

Adds an array of media items to the user's Shazam library. The library only accepts media items with a ``SHMediaItem/shazamID``. The `shazamID` must be a numeric only string. This throws ``SHError/Code/mediaLibrarySyncFailed`` if the system can't add at least one ``SHMediaItem`` or if an error occurred during the addition. In that case, the system doesn't add any items to the library. - Parameters: - items: An array containing the ``SHMediaItem`` objects to add to the library.

Skipped declarations

No declarations were skipped in this snapshot.

All ShazamKit types →