Git Product home page Git Product logo

asapplemusic's Introduction

ASAppleMusic 🍎🎵

Version License Platform Build Status

About

ASAppleMusic allows you as developer to get all the Apple Music data from the catalog including: albums, artists, tracks, etc. To know more about that API take a look at the Apple Music API website.

Docs

ASAppleMusic API Docs

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • Xcode 9.0+
  • iOS 11.0+

Installation

ASAppleMusic is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'ASAppleMusic'

Usage

To use this class just call the singleton shared and each getter method to get the API object desired. By default the token used will be the Developer token and there's logging enabled, if you want to change both things just change the value of source and debugLevel attributes.

This API is configured as you should know how to generate developer and user tokens, for more info visit the Apple Music API.

You should create your own web server that receives parameters as POST request in the body in JSON format like:

{
   "kid": "C234234AS",
   "tid": "AS234ASF2"
}

and should return the token in JSON format:

{
   "token": "alf9dsahf92fjdsa.fdsaifjds89a4fh"
}

Not Available (WIP)

  • Recents
  • Recommendations
  • Reviews

Android version

AAAppleMusic 🎵

By Aaron Asencio

Author

Alex Silva

License

ASAppleMusic is available under the CC BY-SA 4.0 license. See the LICENSE file for more info.

asapplemusic's People

Contributors

alexsilvacodes avatar

Stargazers

 avatar HackerVerse avatar ppm avatar Sergey Petrachkov avatar Kravchenko Igor avatar Naman Vaishnav avatar  avatar Eugene Zhuk avatar noppe avatar Renaud Bouissière avatar Foti Dim avatar  avatar

Watchers

 avatar Wael avatar

Forkers

uthiel dylanreich

asapplemusic's Issues

source = .user returns SSErrorDomain Code=100 "Cannot connect to iTunes Store"

Steps to reproduce:

  • Use the demo project as is
  • Add ASAppleMusic.shared.source = .user right after initialization
  • Try trough an iPhone device to make a search request. I used "us", "songs" and "binge" as term.

I am getting:

2018-06-28 23:11:26.629494+0200 ASAppleMusic_Example[334:14718] [core] "Error returned from daemon: Error Domain=com.apple.accounts Code=9 "(null)""
2018-06-28 23:11:26.629774+0200 ASAppleMusic_Example[334:14718] SSAccountStore: Failed to fetch the backing accounts. error = Error Domain=com.apple.accounts Code=9 "(null)"
2018-06-28 23:11:26.632496+0200 ASAppleMusic_Example[334:14810] [core] "Error returned from daemon: Error Domain=com.apple.accounts Code=9 "(null)""
2018-06-28 23:11:26.632698+0200 ASAppleMusic_Example[334:14810] SSAccountStore: Failed to fetch the backing accounts. error = Error Domain=com.apple.accounts Code=9 "(null)"
2018-06-28 23:11:26.644030+0200 ASAppleMusic_Example[334:14810] SSAccountStore: Unable to get the local account. error = Error Domain=SSErrorDomain Code=100 "Cannot connect to iTunes Store" UserInfo={NSLocalizedDescription=Cannot connect to iTunes Store}
[ASAppleMusic] 🛑: Missing token

Great Demo, Thank you

I've learn't a lot from this, thank you it came to me at the right time, there is still room for improvements. If there was a better way to make callWithToken a bit more generic and avoid the repeated lines of code for each entity that would be awesome but seriously thank you.

Getting user token - iOS 12 - "Error returned from daemon: Error Domain=com.apple.accounts Code=9 "(null)""

Hi Alex,

Ok, I hope you can help me answer this question please:

There is an error that is generated immediately when running on the device on iOS 12 but the project is targeting iOS 11 on this line:-

let cloudService = SKCloudServiceController()

2018-11-06 23:51:48.615732+1100 MusicPlayer[1187:132479] [core] "Error returned from daemon: Error Domain=com.apple.accounts Code=9 "(null)""
2018-11-06 23:51:48.615862+1100 MusicPlayer[1187:132479] SSAccountStore: Failed to fetch the backing accounts. error = Error Domain=com.apple.accounts Code=9 "(null)"
2018-11-06 23:51:48.621920+1100 MusicPlayer[1187:132479] SSAccountStore: Unable to get the local account. error = Error Domain=SSErrorDomain Code=100 "Cannot connect to iTunes Store" UserInfo={NSLocalizedDescription=Cannot connect to iTunes Store}

My Developer Token is fine but when I try to retrieve the User's token that is when it fails, I googled this for a few hours and a few developers encountered it but there was no clear answer as to why it happens.

I encoded the developer key using this script:
https://github.com/pelauimagineering/apple-music-token-generator

I can get playlists and stuff but just not the user's token !

Thank you

Where is the url for the full length of the song? I can only see the preview url !

Hi Alex,

I am not sure what I am missing?, I can only see the preview url for the songs which is short, not the full length of the song url to play within a player I built.

  "previews" : [
    {
      "url" : "https://audio-ssl.itunes.apple.com/apple-assets-us-std-000001/AudioPreview125/v4/91/85/0f/91850f1d-85b8-1aa0-6eea-e5988b0eb194/mzaf_6254647395340771291.plus.aac.p.m4a",
      "artwork" : null
    }
  ],

I am authenticated using a developer's account. I have now music subscription but wasn't sure where is the full url coming from?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.