Managing Audio with SiriKit
Control audio playback and handle requests to add media using SiriKit Media Intents.
Overview
Configure the Sample Code Project
Before you run the sample code project in Xcode:
Create an App Group for
com.example.apple-samplecode.ControlAudio.Sharedin your developer portal.Create an App ID for
com.example.apple-samplecode.ControlAudioin your developer portal and enable it for App Groups, specifying the group you created in the previous step. Additionally, enable SiriKit.Create a Music ID for
music.com.example.apple-samplecode.ControlAudioin your developer portal.Create a Key for the MusicKit service and create a developer token. For more information on this process, see Generating Developer Tokens.
Copy the developer token to the
developerTokenvariable in theAppleMusicAPIController.swiftfile.Create a provisioning profile for
com.example.apple-samplecode.ControlAudioandcom.example.apple-samplecode.ControlAudio.ControlAudioExtensionin your developer portal.Associate the provisioning profiles with the project in Xcode signing settings.
See Also
Sample code
Adding Shortcuts for Wind DownBooking Rides with SiriKitHandling Payment Requests with SiriKitHandling Workout Requests with SiriKitIntegrating Your App with Siri Event SuggestionsProviding Hands-Free App Control with IntentsSoup Chef: Accelerating App Interactions with ShortcutsSoup Chef with App Intents: Migrating custom intents