npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@raw2dd4/react-native-apple-music

v1.0.6

Published

A react native module for the Apple Music API

Downloads

7

Readme

React Native Apple Music by Bouncy

The Apple Music API is a web service that lets you access information about the media found in the Apple Music Catalog. Here's what each one includes:

Use this service to retrieve information about albums, songs, artists, playlists, music videos, Apple Music stations, ratings, charts, recommendations, and the user's most recently played content. With proper authorization from the user, you can also create or modify playlists and apply ratings to the user's content.

Here's a quick overview of functionalities supported:

  • Get the Charts of an specific Country or global
  • Get recommendations for an user
  • Get the user's most recently played content
  • Create a Playlist
  • Modify Users Playlists

📖 Getting started

npm install @bouncyapp/react-native-apple-music --save

or

yarn add @bouncyapp/react-native-apple-music

Mostly automatic installation

react-native link @bouncyapp/react-native-apple-music --platforms ios

cd ios && pod install && cd ..

💻 Usage

import AppleMusic from '@bouncyapp/react-native-apple-music';

💡 Initialization/Authorization Methods

All functions returning a Promise that resolves to the result.

  • initialize( keyID, teamID, key )

    Initializes the Apple Music module and resumes a logged in session if there is one. This must be the first method you call when using this module.

    • Parameters

      • keyID - (Required) an object with options to pass to the Spotify Module
      • teamID - (Required) Your Apple Developer Team Id
      • key - (Required) You need to create an Key at Apple's Certificates, Identifiers & Profiles Page with MusicKit as Enabled services
    • Returns

      • A Promise that resolves to a boolean when the module finishes initialization, indicating whether or not a session was automatically logged back in
  • login_basic()

    Login every Apple User with your Key. User can call non-personlised api calls like getCharts etc.

    • Returns

      • A Promise that resolves to a boolean, indicating whether or not the user was logged in
  • login() (Apple Music Subscription Required)

    Login user with Apple Music Subscription

    • Returns

      • A Promise that resolves to a boolean, indicating whether or not the user was logged in
  • getICloudID()

    Get the iCloud ID of my Apple Account

    • Returns

      • A Promise that resolves the iCloud Id
  • getSongCharts()

    Get the current Apple Music Charts

    • Returns

      • A Promise that resolves the Apple Music Charts
  • getAlbumCharts()

    Get the current Apple Music Album Charts

    • Returns

      • A Promise that resolves the Apple Music Album Charts
  • searchSong(query)

    Search for Songs at Apple Music

    • Returns

      • A Promise that resolves an Array with Songs
  • searchAlbum(query)

    Search for Albums at Apple Music

    • Returns

      • A Promise that resolves an Array with Albums
  • searchArtist(query)

    Search for Artists at Apple Music

    • Returns

      • A Promise that resolves an Array with Artists
  • searchPlaylist(query)

    Search for Playlists at Apple Music

    • Returns

      • A Promise that resolves an Array with Playlists
  • getSong(id)

    Get an specific song by id

    • Returns

      • A Promise that resolves the requested song
  • getSongs([ids])

    Get songs by id

    • Returns

      • A Promise that resolves the requested songs
  • getSongWithIsrc(isrc)

    Get an specific song by isrc

    • Returns

      • A Promise that resolves the requested song
  • getAlbum(id)

    Get an specific album by id

    • Returns

      • A Promise that resolves the requested album
  • getPlaylist(id)

    Get an specific Catalog Playlist by id

    • Returns

      • A Promise that resolves the requested playlist
  • getArtist(id)

    Get an specific artist by id

    • Returns

      • A Promise that resolves the requested artist
  • getUserPlaylists() (Apple Music Subscription Required)

    Get the Playlists of my Apple Music Account

    • Returns

      • A Promise that resolves an Array with Playlists
  • getUserPlaylist(id) (Apple Music Subscription Required)

    Get a Playlist of my Apple Music Account

    • Returns

      • A Promise that resolves to the requested Playlist
  • recentPlayed() (Apple Music Subscription Required)

    Get the recently played songs, albums, artists of my Apple Music Account

    • Returns

      • A Promise that resolves an Array with songs, albums, artists
  • getHeavyRotation() (Apple Music Subscription Required)

    Heavy Rotation is a collection of albums and playlists selected based on your iPhone listening habits.

    • Returns

      • A Promise that resolves an Array with songs, albums, artists
  • getRecommendations() (Apple Music Subscription Required)

    Get songs, albums, artists recommendations of my Apple Music Account

    • Returns

      • A Promise that resolves an Array with songs, albums, artists
  • addToPlaylist(playlistId, songId) (Apple Music Subscription Required)

    Add the song to the playlist in my Apple Music Account

    • Returns

      • A Promise that resolves to "204" if successfull

TODO

  • Return a user session after login

✨ Credits

🤔 How to contribute

Have an idea? Found a bug? Please raise to ISSUES. Contributions are welcome and are greatly appreciated! Every little bit helps, and credit will always be given.

💖 Support Bouncy

AppStore

Google Play Store

Thanks! ❤️