How To: Use Siri to Play Spotify Music & Start Playlists

How To: Use Siri to Play Spotify Music & Start Playlists
With the Shortcuts app, you can build workflows to automate complex tasks, most of which can be activated with a simple, customized Siri command. You can download videos from Instagram and open links in Chrome instead of Safari with just your voice, for instance. But a more popular discovery is using Siri to control music streaming apps like Spotify, not just Apple Music.Being able to use Siri to control Spotify music has been wanted for some time by Spotify users. Right now, all you can do is open the Spotify app, then pause and skip tracks after you start play manually, and Spotify knows this. Yet, it still has no immediate plans to use either SiriKit or the Shortcuts API to enable Siri access to the Spotify app. Instead, it spent more time on its own in-app Spotify Voice tool.Spotify Voice is not as cool as using Siri, so Reddit user fernix96 (Lorenzo Ferrante) created his own shortcut for iOS 12 that lets you use Siri to play a track or playlist on Spotify. He plans on turning this into a full app called Shortify, so be on the look out for that. In the meantime, if you're on team Spotify and are interested in setting up this shortcut on your iPhone, follow along below. Just be warned, there's some work involved, so familiarity with the Shortcuts app will come in handy.Don't Miss: How to Use the Shortcuts App for Custom Siri Actions Before going any further, make sure you have the most up-to-date version of Shortcuts available, currently 2.1.2, as well as the latest version of iOS 12. If you don't, you might get the "Sorry, there was a problem with the app" response from Siri when trying to play Spotify songs or playlists.

Step 1: Log into Spotify for DevelopersThis may seem like an odd requirement, but to make Siri control Spotify, you'll need a Spotify for Developers account. Dev accounts for Spotify are free, and you'll need it because you need to connect the script in a future step with a few items from your dev account to make this all work.In your web browser of choice, visit developer.spotify.com/dashboard on your iPhone, then choose the "Log In" option. You don't need to create a separate dev account — just sign in with your existing Spotify free or premium account. Once you sign in, accept the terms of service, and your developer account is ready to go. (Note, if you have issues accepting the terms in Safari, try another browser.)

Step 2: Create an App in Spotify for DevelopersIn your Spotify for Developers account, go to Dashboard from the menu if you're not already there, then tap on "Create a Client ID." Enter any name and description for the application, something that describes what it will do, then check the "Mobile App" box. Hit "Next," select "No" for commercial integration, then hit "Submit" after agreeing to the three options.

Step 3: Install & Rename the Shortify ShortcutStepping away from the Spotify for Developers account for a second, install Ferrante's shortcut called "Shortify2" (it's the second version of his workflow). You won't find this by browsing or searching the "Gallery" in the Shortcuts app, so follow the link below to get it.Shortcuts Link: Shortify2 (free) The link will open up Shortify2's info page in Shortcuts. Tap "Get Shortcut" to install it. Next, go to the "Library" tab, then either 3D Touch on it or tap the ellipsis (•••) to open up the shortcut editor. Tap on the "Settings" icon in the top right, then "Name," and change it to just "Shortify," which will be used to link the script necessary with this shortcut. Hit "Done" when finished.

Step 4: Install ScriptableFor this whole process to work, you'll need a little bit of JavaScript to connect the Shortcuts app with the app you made in your Developer for Spotify account. So, you'll need an app that lets you edit and save JavaScript, and Scriptable is a fine choice.App Store Link: Scriptable (free)

Step 5: Create a New ScriptThat might sound intimidating if you don't know any JavaScript, but you don't have to worry. Ferrante did all the leg work with his Shortify.js file, and all you need to do is visit its GitHub page and copy the whole script. For your convenience, you may also copy his script from below. // Base64 encoding of your credentials
let clientID = '<your client id>'
let clientSecret = '<your client secret>'
let cred = clientID + ':' + clientSecret
let credEncoded = Data.fromString(cred).toBase64String()
let auth = 'Basic ' + credEncoded

// Get token
let tokenURL = 'https://accounts.spotify.com/api/token'
var reqToken = new Request(tokenURL)
reqToken.method = 'POST'
reqToken.body = 'grant_type=client_credentials&undefined='
reqToken.headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': auth
}

let res = await reqToken.loadJSON()
let token = res['access_token']
let auth2 = 'Bearer ' + token

// Params
var q = encodeURI(URLScheme.parameter('query'))
var t = URLScheme.parameter('type')

let endpoint = 'https://api.spotify.com/v1/search?q=' + q + '&type=' + t
let method = 'GET'
let headers = {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': auth2
}

// Make the request
let req = new Request(endpoint)
req.method = method
req.headers = headers

// Get the track URL
let json = await req.loadJSON()

var finalURL = ''
if (t == 'track') {
finalURL = json['tracks']['items'][0]['external_urls']['spotify']
} else {
finalURL = json['playlists']['items'][0]['external_urls']['spotify']
}

// Open the track on Spotify
Safari.open(finalURL) Once you've copied the script to your clipboard, open up the Scriptable app, tap the plus (+) icon to start a new script, then paste the Shortify.js text inside it. Tap on "Untitled Script" up top and rename it "Shortify" so that it works with the Shortify shortcut from earlier. Hit "Rename" to finalize it. We're not done yet, since we need to change a few things in the script.

Step 6: Copy Info from Your Dev DashboardGo back to developer.spotify.com/dashboard in your browser, find the Spotify app you created earlier, tap on it, and copy its "Client ID." You'll be pasting this ID into the Shortify script you're making. You'll also need to copy the "Client Secret" identifier, but you can only copy one thing at a time.

Step 7: Save Script with Client ID & Client SecretGo back to the Shortify script in Scriptable, then find <your client id> on the second line. Highlight <your client id>, including the angle brackets, then paste your "Client ID" over top of it. Next, go back to Step 6, tap "Show Client Secret," and copy the digits there. Come back here in Scriptable and paste it over top <your client secret>. Tap on "Done" in the top left to save it.

Step 8: Choose Either Track or Playlist in ShortcutsUnfortunately, this shortcut we're making can only listen for either a track or a playlist; it can't listen for both. So edit the Shortify shortcut in the Shortcuts app again, and enter either "track" or "playlist" into the second Text box in the workflow, right below the second Comment box.If you have a premium Spotify account, you can choose "track" so you can you play a specific song right away using the shortcut. However, for "playlist," which works for both premium and free Spotify accounts, it will just open up the playlist in Spotify, not start playing right away. I have premium, so I chose to search for tracks, which is the default, because that broadens my options in Spotify. You can always go back and switch "track" for "playlist" if you're so inclined. You could also duplicate this entire shortcut with a different name and Siri command (the Siri command is coming up in the next step) so that you can search for both songs and playlists without having to edit the command.

Step 9: Add a Siri CommandFinally, you must add a Siri command to make this all work. So while still editing your Shortify shortcut's workflow, tap the "Settings" icon just like you did when changing the shortcut's name. Next, tap "Add to Siri," then "Type Phrase" to set the Siri command you want to use. You can go with anything, although something simple like "Search Spotify" should do the trick. When ready, tap "Done" three times in succession to save and exit the workflow. You're done here!

Step 10: Use Siri to Play Music on SpotifyNow it's time to test out all your hard work. Open up Siri how you normally would, whether it's with "Hey Siri" or the Side or Home button shortcut, then say your Siri phrase from the previous step. Siri will ask you what you'd like to hear, then the "Dictate Box" will open in Shortcuts. Say either a song or playlist name, depending on which route you went when setting the shortcut up.The shortcut will quickly reroute to the Shortify.js script which will use Safari to connect to your dev app and use a URL scheme to open Spotify and play the song or playlist you asked for. For playlists, it will only open the most popular public playlist closest to the title you mentioned, so you can't actually open your own playlists. That's just another reason why the "track" option is the most useful. If you've created the Shortify shortcut here and had issues, or have any other questions, feel free to drop a comment down below. We'll try to help you troubleshoot any problems you ran into.Don't Miss: Calculate Tips Faster on Your iPhone Using the Shortcuts AppFollow Gadget Hacks on Pinterest, Reddit, Twitter, YouTube, and Flipboard Sign up for Gadget Hacks' daily newsletter or weekly Android and iOS updates Follow WonderHowTo on Facebook, Twitter, Pinterest, and Flipboard
Cover photo by Justin Meyers/Gadget Hacks; Screenshots by Nelson Aguilar/Gadget Hacks



As you might expect, Developer options are cleverly hidden away by default, but it's easy to enable if you know where to look. Find your Android Build number. Before you can enable Developer
Enable Developer Options in Android 4.3/4.2 or later


Blackberry KeyONE Teardown - and GIVEAWAY!! I will also show how to remove the battery on the blackberry KeyOne. Blackberry KeyOne vs Blackberry Key 2: 5 Quick Reasons to Upgrade!
How to set up keyboard shortcuts on the BlackBerry KEYone


Not so long ago we heard rumors that the Samsung Galaxy S10 and Samsung Galaxy S10 Plus would soon be offered in a 'Cardinal Red' shade, and while at the time there was no mention of the
The Samsung Galaxy S8 Is Now Available in Burgundy Red


If your power button is not working properly, then don't worry. There are plenty of ways to restart Android without power button. In this guide, we will provide five different ways to teach you how to restart Android phone without Power button. Let's get it started with! Part 1: Restart Android without power button (when phone is still off)
How to Shut Down an iPhone or iPad Without Using the Power Button
osxdaily.com/2017/10/08/shut-down-iphone-ipad-without-power-button/
The latest versions of iOS offer a nice software feature that allows users to easily shut down an iPhone or iPad entirely through system menu options, without having to use the power button or any other physical buttons on the device at all.


A computer running Windows, macOS or Linux; Ad-hoc Wifi network created by your computer/laptop or a portable router; Enable Hotspot tethering on iPhone without your carrier knowing Installation. Step 1 Connect your iPhone to your computer or laptop. Step 2 Open Cydia Impactor and ensure it recognizes your device.


How to Get Kodi Subtitles Using OpenSubtitles. Opensubtitles is probably the best subtitles service for Kodi. This service has subtitles in a wide range of languages and for nearly all the movies and TV shows that have been released so far. If you are looking for Kodi subtitles, OpenSubtitles will always be my first recommendation.
Kodi Subtitles Addon: Get Subtitles For Everything You Play


A new API in Android Lollipop allows apps to color the status bar to match their overall theme. Google billed this as a more immersive user experience that allows app developers to extend their color branding even further.
How to Move the Clock Back to the Right Side on Your Galaxy

How to Enable Javascript and update Flash in Firefox - Internet


How To: YouTube Finally Has a Dark Theme on Android — Here's How to Get It How To: Enable Dark Mode in Chrome for Android How To: Change Slack's Sidebar Theme on Your iPhone or Android Phone for Customized Colors
How to Change Facebook's Boring Blue Theme to Any Color You


Self Destructing Messages With ProtonMail, emails are no longer permanent. You can set an optional expiration time on ProtonMail's encrypted emails, so they will be automatically deleted from the recipient's inbox once they have expired.
Email How - Tips & Tricks


Google Chrome is set to go dark soon, but if you can't wait, here's how to enable Google Chrome dark mode on Windows 10. Here's how to enable the hidden Google Chrome dark mode on Windows 10
How to Use a Dark Theme in Windows 10


LG V20: everything you need to know which lets you search through all your apps for quick access to the information you need. we are giving our customers more of everything they love and
How to Clear Windows 10 Quick Access History in File Explorer


A video about The Chat Room by Vicki Perry - 17 views - 0 people liked it. A humorous look at Internet chat room etiquette.
Video - How To Behave In Internet Chat Rooms | Final Fantasy


Android Pie vs Android Oreo: volume control Press the volume buttons on an Android Oreo phone and the control that pops-up will vary depending on the context. If there's a song or video playing
bacidea.com

How to Solder Stainless Steel: 7 Steps (with Pictures

0 comments:

Post a Comment