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

terrier-capacitor-musickit

v0.1.2

Published

...

Downloads

3

Readme

Capacitor Apple Music Kit plugin

by Terrier&Terrier

Plugin is still under development, it was implemented because we needed Apple Music Kit integration in existing IONIC application.

Every contribution and help is welcome. The plugin is under MIT licence, we do not take responsibility for any damage which could be caused with usage of our plugin.

We are aware that many things need to be implemented and the plugin is not finished yet. We have developed functions which were needed for our usage any upgrades are more than welcome.

If you have any questions, suggestions, ideas or messages, please contact me at: [email protected]. 🤘🏻

How to use it?

Plugin can be installed with npm: npm i terrier-capacitor-musickit

Currently, we have supported following methods:

  • authorizeUser(options: {devToken: string}) : Promise<any>
  • isUserAuthorized() : Promise<boolean>
  • getUserToken(): Promise<string>
  • addToPlayerQueue(options: {mediaId: string}): Promise<any>
  • play(): Promise<any>
  • pause(): Promise<any>
  • stop(): Promise<any>
  • rewind(): Promise<any>
  • forward(): Promise<any>
  • toFirstSong(): Promise<any>
  • currentPlayingItem(): Promise<string>

Expected usage flow is:

  1. calling authorizeUser(options: {devToken: string}) method with your developer token as parameter. How to obtain your developer token? For testing purposes we suggest simply to use Apple music token generator from here. User will be prompted to allow access to their music library and if they approve, everything is fine. Otherwise, everything has gone to hell. 👿
  2. If you use any other external libraries to access Apple API and you would need to know unique user token, simply call getUserToken() method.
  3. Plugin also includes integrated MediaPlayer which means that music will be played directly inside system iOS music player. All song details will be available inside system music player as well.
  4. Now you need to add a song (or more) into player queue. This can be made by calling addToPlayerQueue(options: {mediaId}) method. mediaId parameter is unique Id of song/playlist/video ... It is included in response of Apple catalog API request as Id parameter.
  5. Now you can integrate buttons of your in-app player with native methods: play(), pause(), stop(), forward(), rewind(), toFirstSong().
  6. If you want to show current playing item, simply call currentPlayingItem() method. It will return response in the following format:
{
	"currentItem":"{\"title\":\"Minority\",\"duration\":354.66699999999997,\"artist\":\"Green Day\"}"
}

Note: for continue usage, currentItem property needs to be parsed and object will be returned.

One important thing before deploy

Before deploying to actual device, please keep in mind that you will need to add Privacy - Media Library Usage Description property into your Info.plist file. Value of the property describes why your app needs access to user Apple Music library. This info is shown on prompt. The app will crash if that property will be missing. (Based on personal experiences 😂).

Did we help you?

Great, we are really glad! Check our Party Animal app in Apple store, it will help you when you'll organise your party!