Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scottrhoyt/cider
The Missing Apple Music SDK. Written in Swift.
https://github.com/scottrhoyt/cider
apple apple-music-api carthage cocoapods music swift swift-package-manager
Last synced: 4 days ago
JSON representation
The Missing Apple Music SDK. Written in Swift.
- Host: GitHub
- URL: https://github.com/scottrhoyt/cider
- Owner: scottrhoyt
- License: mit
- Created: 2017-08-01T23:12:06.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-10-19T09:36:25.000Z (about 5 years ago)
- Last Synced: 2024-11-10T15:26:24.884Z (5 days ago)
- Topics: apple, apple-music-api, carthage, cocoapods, music, swift, swift-package-manager
- Language: Swift
- Homepage:
- Size: 1.54 MB
- Stars: 57
- Watchers: 7
- Forks: 16
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Cider
The Missing Apple Music SDK. Written in Swift.[![Build Status](https://travis-ci.org/scottrhoyt/Cider.svg?branch=master)](https://travis-ci.org/scottrhoyt/Cider)
[![codecov.io](https://codecov.io/github/scottrhoyt/Cider/coverage.svg?branch=master)](https://codecov.io/github/scottrhoyt/Cider?branch=master)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![CocoaPods](https://img.shields.io/cocoapods/v/Cider.svg)](https://cocoapods.org/pods/Cider)
[![SPM compatible](https://img.shields.io/badge/SPM-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)
![Platform iOS](https://img.shields.io/badge/Platform-iOS-blue.svg)
[![Language Swift 4.0](https://img.shields.io/badge/Language-Swift%204.0-orange.svg)](https://swift.org)### Installation
#### Carthage
Add the following to your Cartfile:
```sh
github "scottrhoyt/Cider" ~> 0.10
```#### CocoaPods
Add the following to your Podfile:
```sh
pod 'Cider', '~> 0.10'
```#### SPM
Add to your `Package.swift` file like so:
```swift
import PackageDescriptionlet package = Package(
name: "",
dependencies: [
.package(url: "https://github.com/scottrhoyt/Cider.git", from: "0.10.0")
]
)
```### Usage
#### Developer Token
To use the Apple Music API, you will need to generate a developer token.
Instructions for how to do this can be found in the Apple Music API
[reference](https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/AppleMusicWebServicesReference/SetUpWebServices.html#//apple_ref/doc/uid/TP40017625-CH2-SW1).Once you have an Apple Music Key you can use a 3rd party library/tool to
generate your token. I created a Node.js library and CLI tool that you can find
[here](https://github.com/scottrhoyt/apple-music-jwt).#### Create a Client
```swift
let developerToken = ""
let cider = CiderClient(storefront: .unitedStates, developerToken: developerToken)
```#### Search the Catalog
```swift
cider.search(term: "Michael Jackson", types: [.albums, .songs]) { results, error in
// Process the results or error
}
```#### Lookup an Artist/Album/Song
```swift
let songId = ""
cider.song(id: songId) { result, error in
// Process the results or error
}
```### API Reference
The full API reference can be found [here](https://scottrhoyt.github.io/Cider).
### License
MIT