AudiomackSwiftLibrary
Documentation
Access the full API documentation here.
Getting Started
Getting Started as on- Request an API key on the Contact Us page
- The API key and associated secret will be used to identify your application when making requests to the API
- All requests must be signed using the oAuth standard
- Send any API support questions to [email protected]
Requirements
- iOS 8.0+
- Xcode 10+
- Swift 4.0+
Installation
AudiomackSwiftLibrary is available through CocoaPods. To integrate AudiomackSwiftLibrary into your Xcode project using CocoaPods, specify it in your Podfile
:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
target '<Your Target Name>' do
pod 'AudiomackSwiftLibrary', '~> 4.7'
end
Then, run the following command:
$ pod install
Basic Usage
Audiomack only supports Oauth 1.0. To initialize and use AudiomackSwiftLibrary,
import AudiomackSwiftLibrary
let client = AudiomackClient(consumerKey: "YOUR_CONSUMER_KEY", consumerSecret: "YOUR_CONSUMER_SECRET")
//TO GET ARTIST DETAILS
client.getArtistDetails(slug: "eminem") { (result) in
switch result{
case let .success(response):
print(response)
//response - AudiomackUser Object
case let .failure(error):
print("error \(error.localizedDescription)")
if (error.audiomackError != nil) {
print(error.audiomackError)
}
}
}
//TO GET MUSIC DETAILS
client.getMusic(id: "2077853") { (result) in
switch result{
case let .success(response):
print(response)
//response - AudiomackMusic Object
case let .failure(error):
print("error \(error.localizedDescription)")
if (error.audiomackError != nil) {
print(error.audiomackError)
}
}
}
// TO GET ARTIST UPLOADS
client.getArtistUploads(slug: "eminem") { (result) in
switch result{
case let .success(response):
print(response)
case let .failure(error):
print("error \(error.localizedDescription)")
if (error.audiomackError != nil) {
print(error.audiomackError!.message)
}
}
}
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
Features
Unauthenticated Requests
Music
- Get Music Details
- Get Most Recent Music
- Get Genre-specific Most Recent Music
- Get Trending Music
- Get Genre-specific Trending Music
- Flag Unplayable Track
- Play Track
Artists
- Get Artist Details
- Get Artist Uploads
- Get Artist Favorites
- Search Artist Favorites
- Get Artist Playlists
- Get Artist Following / Followers
- Get Artist Feed
Playlists
- Get Playlist Details
- Get Trending Playlists
- Get Genre-specific Trending Playlists
Charts
- Get Chart Tracks
- Get Gender Specific Chart Tracks
Search
- Search Song / Artist / Playlist / Album
- Search Autosuggest
Authenticated Requests
Music
- Favorite / Unfavorite a song / album
- Repost / Unrepost a song / album
Artists
- Follow / Unfollow an artist
Playlists
- Create playlist
- Edit playlist
- Delete playlist
- Add song(s) to playlist
- Remove song from playlist
- Favorite / Unfavorite playlist
User
- Register user
- Get User Details
- Forgot Password
- Get User Playlists
- Get User Uploads
- Get User Favorites
- Get User Notifications
Not Supported calls in AudiomackSwiftLibrary
- Getting Artist Pinned Content
- Marking User Notifications as Seen
- Getting Aggregations Lists for Notifications
- Getting list of activities for an Aggregation
Author
Fitzafful, [email protected]
License
AudiomackSwiftLibrary is available under the MIT license. See the LICENSE file for more info.