Code Monkey home page Code Monkey logo

musicsensekit's Introduction

MusicSenseKit

An iOS framework that provides Music Sensing functionality to your applications. Currently support music data from Apple Music.

Supported Sensors

The following music item types are currently supported in MusicSenseKit:

  • Album
  • Track
  • Playlist
  • Artist

These three music data type can cover most of the usage scenarios of music service.

The following user music data are currently supported in MusicSenseKit:

  • Library Albums
  • Library Playlists
  • Library Artists
  • Recently Added Resources
    • Recently Added Albums
    • Recently Added Playlists
  • Recently Played Resources
    • Recently Played Albums
    • Recently Played Playlists
  • Recently Tracks

Installing the Framework

You can easily install MusicSenseKit Framework by adding a SwiftPM to your Xcode iOS project.

Using the Library

Import and init MusicSenseKit as shown below:

Swift

import MusicSenseKit

let libraryAlbums = try await MusicSenseKit.libraryAlbums()

let recentTracks = try await MusicSenseKit.libraryTracks()

Configure the framework with an iOS App

This framework must be run on a physical device (i.e., an iPhone).

Before you run the project in Xcode, perform the following steps:

  1. In the Project navigator, select the project and click the Signing & Capabilities tab.
  2. Select your developer team from the Team menu.
  3. Choose a new bundle identifier for the Your App target, and enter it in the Bundle Identifier field. The bundle identifier within the project has an associated App ID, so you need a unique identifier to create your own App ID. Use a reverse-DNS format for your identifier, as Preparing Your App For Distribution describes.
  4. In Safari, visit the Certificates, Identifiers, and Profiles section of the developer web site.
  5. Select Identifiers and click the Add button to create a new App ID for Your App. Follow the steps until you reach the Register an App ID page.
  6. For the Bundle ID, select Explicit, and enter the bundle identifier from step 2.
  7. Click the App Services tab, and select the MusicKit checkbox.
  8. Complete the App ID creation process.

After creating your App ID, your Xcode project needs no additional configuration. The App Service is a run-time service that automatically associates with app's bundle ID.

Required Info.plist Keys

Depending on the used sensor and its configuration, some keys with a user-friendly description should be included in the info.plist application file:

Music

Privacy - Media Library Usage Description: NSAppleMusicUsageDescription


Thanks for Apple Developer Forum and related materials on WWDC that have so many useful information helped me to build this.

For future features, I want to add more data types. Or make it compatible with Spotify.

musicsensekit's People

Contributors

zerow27 avatar

Stargazers

 avatar

Watchers

 avatar

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.