Contents

add(_:completionHandler:)

Adds an array of songs to the user’s Shazam library.

Declaration

func add(_ mediaItems: [SHMediaItem], completionHandler: @escaping  @Sendable ((any Error)?) -> Void)
func add(_ mediaItems: [SHMediaItem]) async throws

Parameters

  • mediaItems:

    An array of media items that represents the songs to add to the library.

  • completionHandler:

    The system calls this completion block after adding the media items to the library.

    This block takes the following parameters:

    error

    An error object if a problem occurs when adding any item; otherwise, nil.

Discussion

Saving a song to the user’s Shazam library also saves the following media item properties and their associated values:

See Also

Adding a matched song to the library