Skip to content

feat: Add Apple Music deep-linking from now-playing UI#100

Open
devin-ai-integration[bot] wants to merge 1 commit into
developfrom
devin/1782051556-apple-music-deep-linking
Open

feat: Add Apple Music deep-linking from now-playing UI#100
devin-ai-integration[bot] wants to merge 1 commit into
developfrom
devin/1782051556-apple-music-deep-linking

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Summary

Tapping the now-playing card (artwork, title, or the new open-in-music button) deep-links to the currently playing song/album/playlist in Apple Music instead of just opening the app.

MusicController.NowPlaying gains optional catalogSongId / catalogAlbumId / catalogPlaylistId. These are populated from the target ID in play() and from the resolved MusicItemID in setMusicMood() — library-only IDs (i.*, l.*, p.*) are excluded so only catalog IDs are stored.

// Deep-link resolution order in openInAppleMusic():
1. currentTrackDeepLinkURL()                // live queue entry → music://…/song/{id}
2. MusicController.appleMusicDeepLinkURL()  // NowPlaying metadata → song/album/playlist URL
3. URL("music://")                          // fallback: just open Apple Music

URL construction follows Apple's music:// scheme:

  • Song: music://music.apple.com/song/{songId} (or …/album/{albumId}?i={songId} when album ID is also available)
  • Album: music://music.apple.com/album/{albumId}
  • Playlist: music://music.apple.com/playlist/{playlistId}

UI additions in MusicMiniPlayerView:

  • Expanded card: new cardOpenInMusicButton (arrow.up.forward.app SF Symbol, pink tint) at top-left — symmetrical with the dismiss ✕ button
  • Minimized pill: long-press (0.5s) gesture opens Apple Music directly, keeping the existing tap-to-expand behavior intact
  • Existing tap targets on card artwork and title remain, now with proper deep links

Link to Devin session: https://app.devin.ai/sessions/a2cb25161e7e4a95b0bcc76399ed5c67

- Store catalog IDs (song, album, playlist) in NowPlaying metadata
- Build music:// deep-link URLs from catalog IDs
- Query current queue entry for live song ID on track advancement
- Add 'Open in Apple Music' button (arrow.up.forward.app) to expanded card
- Add long-press gesture on minimized pill to open Apple Music directly
- Fall back to opening Apple Music app generically for library-only content

Co-Authored-By: bot_apk <apk@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author
Original prompt from API User

Add deep-linking support so that when a song is playing in Loop (via the Apple Music integration), tapping the song card/now-playing UI opens that song or playlist directly in the Apple Music app.

Requirements:

  1. The now-playing UI should be tappable — when tapped, it should open Apple Music to the currently playing song, album, or playlist.
  2. Use Apple's MusicKit / music:// deep-link URLs:
    • For a song: music://music.apple.com/song/{songId} or music://music.apple.com/album/{albumId}?i={songId}
    • For an album: music://music.apple.com/album/{albumId}
    • For a playlist: music://music.apple.com/playlist/{playlistId}
  3. The now-playing view model should expose the catalog IDs (song id, album id, playlist id) that are available from the current playback state. The play_music tool already accepts catalog ids — ensure the playback metadata includes enough info to construct the deep link.
  4. If no catalog ID is available (e.g., user-library-only content), gracefully fall back to opening the Apple Music app generally.
  5. Add the review user ashbhat as a reviewer on the PR.

Implementation notes:

  • The relevant Swift files are likely in the music player / now-playing UI layer. Search for where MPMusicPlayerController or the now-playing card view is implemented.
  • The deep link can be triggered with UIApplication.shared.open(URL) using the music:// scheme.
  • Make sure the tap target is clearly indicated in the UI (e.g., a tappable area on the song title/artwork with a subtle hint).

Please add ashbhat as a reviewer on the PR.

Repository: theashbhat/LoopHarness

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@vercel

vercel Bot commented Jun 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
loop-harness Ready Ready Preview, Comment Jun 21, 2026 2:23pm

@devin-ai-integration devin-ai-integration Bot requested a review from ashbhat June 21, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants