Skip to content

Using the AAAppleMusic API for Android, you can access information about media—such as albums, songs, artists, and playlists—in the Apple Music catalog, using your Apple Music developer token.

Notifications You must be signed in to change notification settings

aaronat1/AAAppleMusic

Repository files navigation

AAAppleMusic

AAAppleMusic allows you as Android 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.

Example

Clone or download the repository and run the example project.

Requirements

  • minSdkVersion 19

Installation

To get a Git project into your build:

Step 1. Add the JitPack repository to your build file. Add it in your root build.gradle at the end of repositories:

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

Step 2. Add the dependency

dependencies {
	compile 'com.github.aaronat1:AAAppleMusic:1.0.0'
}

Step 3. Disable annotations (this library use lombok)

javaCompileOptions {
    annotationProcessorOptions {
        includeCompileClasspath false
    }
}

How to use it

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"
}

Example code:

AAApleMusic.get().setToken("Bearer XXXXXXXXX.........");

AAApleMusic.get().getArtist("us", "178834", new Callback<Artist>() {
    @Override
    public void onResponse(Call<Artist> call, Response<Artist> response) {
        if (response.isSuccessful()) {
            Log.e("OK: ", response.body().getArtist().getAttributes().getName());
        } else {
            Log.e("ERROR: ", response.message());
        }
    }

    @Override
    public void onFailure(Call<Artist> call, Throwable t) {
        Log.e("Error: ", "Getting artist error");
    }
});

IOS Version

ASAppleMusic - by Alex Silva

License

Copyright 2018 Aaron Asencio Tavio

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

Using the AAAppleMusic API for Android, you can access information about media—such as albums, songs, artists, and playlists—in the Apple Music catalog, using your Apple Music developer token.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages