SoundCloud

1.0.3

📦 Swift Package for making authenticated requests to SoundCloud public API
superturboryan/SoundCloud-Swift

What's New

1.0.3

2023-11-27T13:42:20Z
  • Portuguese (pt-br) localized strings

📦 SoundCloud

SoundCloud supports iOS, macOS, and watchOS SoundCloud supports Swift Package Manager (SPM)

SoundCloud is a Swift Package that implements the SoundCloud Public API Specification (v1.0.0) .

It handles the logic for authenticating with a SoundCloud account using the OAuth 2.0 standard, and provides an API for streaming audio and accessing track, artist, and playlist data from SoundCloud.

Installation

Add the following line to your project's dependencies in the Package.swift file:

.package(url: "https://github.com/superturboryan/SoundCloud-api"),

and include "SoundCloud" as a dependency for your executable target:

.target(name: "Your App", dependencies: ["SoundCloud", ...]),

Setup

Define a custom URL scheme for your app, you will need to provide a redirect URI using the scheme so that the OAuth web page knows how to open your app when it receives the tokens callback.

The redirect URI used when creating the SoundCloud instance must also be paired with the client ID and client secret for your SoundCloud registered app.

Usage

To login using a SoundCloud account:

import SoundCloud

let config = SoundCloudConfig(apiURL: ...)
@StateObject var sc = SoundCloud(config)  
  
...  

    
do {
    try await sc.login()
} catch {
    // Handle login error
}

To get the liked tracks for the current user:

let likedTracks = try await sc.getMyLikedTracks()

Requirements

SoundCloud requires apps to be registered in order to access their public API. See terms of use

Description

  • Swift Tools 5.9.0
View More Packages from this Author

Dependencies

Last updated: Mon Nov 25 2024 12:13:10 GMT-1000 (Hawaii-Aleutian Standard Time)