Demo player for Spotify open API using Swift+Combine
WORK IN PROGRESS
To use the Spotift API is mandatory to create an app in the Spotify Dashboard and link it to our iOS app, to do it follow the next steps.
-
You need to access Spotify dashboard
-
Once access is granted, create a new app entry, more info on Spotify.
- Click create an app
- Fill form/s(maybe more than one form to fill all the required fields)
App Name
App Description
Redirect URIs
(you can choose whatever url you want, ie:https://whatever-you-want.com/callback
)Bundle IDs
(your xCode project bundle id)
Spotify has three ways to authorize usage, we´ll use
Implicit Grant Flow
; if you want to understand the authorization process(Implicit Grant Flow) you can check more information on Spotify -
Once created the app we need two strings to make the iOS app work:
Client id
Redirect Uri
-
Create a file called
"SpotifyCredentials.plist"
like the next snippet and fill with the the valuesClient id
andRedirect Uri
that you have obtained from Spotify dashboard
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>redirectUri</key>
<string>YOUR-REDIRECT-URI</string>
<key>clientId</key>
<string>YOUR-CLIENT-ID</string>
</dict>
</plist>
- You are ready to run the iOS app from xCode