Can’t find what you’re looking for? Tell us your needs, and we’ll create a custom solution for you.

Our Achievements
appfutura
BusinessFirms
DesignRush
GoodFirms
ITFirms
iTRate.co
Mobile App Daily
Tech Behemoths

Looking for more insights? Explore our latest blogs, industry trends, and expert tips.

How to add the Spotify Login Button to your iOS easily using a ViewController with a WebView.

Lets get started!

First, go to dashboard and login with your Spotify account. (You don’t need Spotify Premium to have access to Spotify for Developers.)

Next, create a new app by tapping the box.

Spotify Developer Dashboard Setup

After creating your App . You go to the dashboard of your app, go to EDIT SETTINGS

go to EDIT SETTINGS

In the new window, add your website (if you have one), as Redirect URIs add the name of your app and at the end add :// , for this example is spotifysigninexample://, and lastly, in Bundle IDs add your Bundle Identifier and press SAVE

Add your Bundle Identifier

After filling all the information in the editing setting. You have show client id and client secret

spotify client id and client secret

Creating the Spotify Login Button UI On Welcome page

Xcode Spotify Welcome Screen InterfaceSpotify Login UI in Xcode

After Implementing above welcomeController code and run this code you to see welcome screen UI like this-

Spotify Welcome Screen Mockup

Create a new swift file to put the AuthManager.swift file

Paste the following code inside.

Spotify Login Demo in Xcode

And Replace clientId and redirectURI with Your.

Here, we use the scope user-read-email to get the user’s email address. You can see more about other scopes here(Documentation).

Here create New ViewController (AuthManager) step up authentication and following this code:-

Xcode Spotify Login Project Preview

Next, create a new CocoaTouch file AuthViewController.swift with a WebView and add webView delegate is WKNavigationDelegate and following this code

Xcode Spotify WebView Login Tutorial

After implementing all the above code and go to final results click on sign button and go through the webview in look the signUp screen of Spotify webpage.

Spotify Login on iPhone Mockup
Avatar
Amit Verma

Verified Software Developer

About the Author

I'm Amit Verma, a seasoned Web Developer at IPH Technologies with over 8 years of hands-on experience crafting dynamic and scalable web solutions. I specialize in PHP, WordPress, Laravel, Bootstrap, CSS, and JavaScript, and I'm passionate about writing clean, efficient code that delivers real business results.


WhatsApp
Call us
Get a Call Back