Spotify SDK for iOS

Overview

Spotify iOS SDK

Overview

The Spotify iOS framework allows your application to interact with the Spotify app running in the background on a user's device. Capabilities include authorizing, getting metadata for the currently playing track and context, as well as issuing playback commands.

Please Note: By using Spotify developer tools you accept our Developer Terms of Use.

The Spotify iOS SDK is a set of lightweight objects that connect with the Spotify app and let you control it while all the heavy lifting of playback is offloaded to the Spotify app itself. The Spotify app takes care of playback, networking, offline caching and OS music integration, leaving you to focus on your user experience. Moving from your app to the Spotify app and vice versa is a streamlined experience where playback and metadata always stay in sync.

Key Features

Filing Bugs

Components

How Do App Remote Calls Work?

Terms of Use

Tutorial

Frequently Asked Questions

Key Features

  • Playback is always in sync with Spotify app
  • Playback, networking, and caching is all accounted for by the Spotify app
  • Works offline and online and does not require Web API calls to get metadata for player state
  • Allows authentication through the Spotify app so users don't have to type in their credentials

Filing Bugs

We love feedback from the developer community, so please feel free to file missing features or bugs over at our issue tracker. Make sure you search existing issues before creating new ones.

Open bug tickets | Open feature requests

Requirements

The Spotify iOS framework requires a deployment target of iOS 9 or higher. The following architectures are supported: armv7, armv7s and arm64 for devices, i386 and x86_64 for the iOS Simulator. Bitcode is also supported.

Components

Models

  • SPTAppRemoteAlbum
  • SPTAppRemoteArtist
  • SPTAppRemoteLibraryState
  • SPTAppRemotePlaybackRestrictions
  • SPTAppRemotePlaybackOptions
  • SPTAppRemotePlayerState
  • SPTAppRemoteTrack
  • SPTAppRemoteContentItem
  • SPTAppRemoteUserCapabilities
  • SPTAppRemoteImageRepresentable
  • SPTConfiguration

SPTAppRemote

The main entry point to connect to the Spotify app and retrieve API components. Use this to establish, monitor, and terminate the connection.

SPTAppRemotePlayerAPI

Send playback related commands such as:

  • Play track by URI
  • Resume/pause playback
  • Skip forwards and backwards
  • Seek to position
  • Set shuffle on/off
  • Request player state
  • Request player context
  • Subscribe to player state

SPTAppRemoteImagesAPI

Fetch an image for a SPTAppRemoteImageRepresentable

SPTAppRemoteUserAPI

Fetch/subscribe/set user-related data such as:

  • Fetch and/or subscribe to SPTAppRemoteUserCapabilities
  • Determine if a user can play songs on demand (Premium vs Free)
  • Add/remove/check if a song is in a user's library

SPTAppRemoteContentAPI

Fetch recommended content for the user.

How App Remote calls work

When you interact with any of the App Remote APIs you pass in a SPTAppRemoteCallback block that gets invoked with either the expected result item or an NSError if the operation failed. The block is triggered after the command was received by the Spotify app (or if the connection could not be made).

Here is an example using the SPTRemotePlayerAPI to skip a song:

[appRemote.playerAPI skipToNext:^(id  _Nullable result, NSError * _Nullable error) {
    if (error) {
        // Operation failed
    } else {
        // Operation succeeded
    }
}];

Tutorial and Examples

We provide a few sample projects to help you get started with the iOS Framework in the DemoProjects folder. See the Readme in the DemoProjects folder for more information on what each sample does.

Authentication and Authorization

To communicate with the Spotify app your application will need to get a user's permission to control playback first by using built-in authorization for App Remote. To do that you will need to request authorization view when connecting to Spotify. The framework will automatically request the app-remote-control scope and show the auth view if user hasn't agreed to it yet.

Terms of Use

Note that by using Spotify developer tools, you accept our Developer Terms of Use.

Included Open Source Libraries

Tutorial

This tutorial leads you step-by-step through the creation of a simple app that uses the Spotify iOS SDK to play an audio track and subscribe to player state. It will walk through the authorization flow.

Prepare Your Environment

Follow these steps to make sure you are prepared to start coding.

  • Download the Spotify iOS framework from the "Clone or download" button at the top of this page, and unzip it.
  • Install the latest version of Spotify from the App Store onto the device you will be using for development. Run the Spotify app and login or sign up. Note: A Spotify Premium account will be required to play a track on-demand for a uri.
  • Register Your Application. You will need to register your application at My Applications and obtain a client ID. When you register your app you will also need to whitelist a redirect URI that the Spotify app will use to callback to your app after authorization.

Add Dependencies

  1. Add the SpotifyiOS.framework or SpotifyiOS.xcframework to your Xcode project.

    Import SpotifyiOS.framework

  2. In your info.plist add your redirect URI you registered at My Applications. You will need to add your redirect URI under "URL types" and "URL Schemes". Be sure to set a unique "URL identifier" as well. More info on URL Schemes

    Info.plist

  3. Add #import <SpotifyiOS/SpotifyiOS.h> to your source files to import necessary headers.

Check if Spotify is Active

If a user is already using Spotify, but has not authorized your application, you can use the following check to prompt them to start the authorization process.

[SPTAppRemote checkIfSpotifyAppIsActive:^(BOOL active) {
    if (active) {
        // Prompt the user to connect Spotify here
    }
}];

Authorize Your Application

To be able to use the playback control part of the SDK the user needs to authorize your application. If they haven't, the connection will fail with a No token provided error. To allow the user to authorize your app, you can use the built-in authorization flow.

  1. Initialize SPTConfiguration with your client ID and redirect URI.

    SPTConfiguration *configuration =
        [[SPTConfiguration alloc] initWithClientID:@"your_client_id" redirectURL:[NSURL urlWithString:@"your_redirect_uri"]];
  2. Initialize SPTAppRemote with your SPTConfiguration

    self.appRemote = [[SPTAppRemote alloc] initWithConfiguration:configuration logLevel:SPTAppRemoteLogLevelDebug];
  3. Initiate the authentication flow (for other ways to detect if Spotify is installed, as well as attributing installs, please see our Content Linking Guide).

    // Note: A blank string will play the user's last song or pick a random one.
    BOOL spotifyInstalled = [self.appRemote authorizeAndPlayURI:@"spotify:track:69bp2EbF7Q2rqc5N3ylezZ"];
    if (!spotifyInstalled) {
        /*
        * The Spotify app is not installed.
        * Use SKStoreProductViewController with [SPTAppRemote spotifyItunesItemIdentifier] to present the user
        * with a way to install the Spotify app.
        */
    }
  4. Configure your AppDelegate to parse out the accessToken in application:openURL:options: and set it on the SPTAppRemote connectionParameters.

    - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
    {
        NSDictionary *params = [self.appRemote authorizationParametersFromURL:url];
        NSString *token = params[SPTAppRemoteAccessTokenKey];
        if (token) {
            self.appRemote.connectionParameters.accessToken = token;
        } else if (params[SPTAppRemoteErrorDescriptionKey]) {
            NSLog(@"%@", params[SPTAppRemoteErrorDescriptionKey]);
        }
        return YES;
    }

    If you are using UIScene then you need to use appropriate method in your scene delegate.

    func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
        guard let url = URLContexts.first?.url else {
            return
        }
    
        let parameters = appRemote.authorizationParameters(from: url);
    
        if let access_token = parameters?[SPTAppRemoteAccessTokenKey] {
            appRemote.connectionParameters.accessToken = access_token
            self.accessToken = access_token
        } else if let error_description = parameters?[SPTAppRemoteErrorDescriptionKey] {
            // Show the error
        }
    }

Connect and Subscribe to Player State

  1. Set your connection delegate and attempt to connect.

    self.appRemote.delegate = self;
    [self.appRemote connect];
    - (void)appRemoteDidEstablishConnection:(SPTAppRemote *)appRemote
    {
        // Connection was successful, you can begin issuing commands
    }
    
    - (void)appRemote:(SPTAppRemote *)appRemote didFailConnectionAttemptWithError:(NSError *)error
    {
        // Connection failed
    }
    
    - (void)appRemote:(SPTAppRemote *)appRemote didDisconnectWithError:(nullable NSError *)error
    {
        // Connection disconnected
    }
  2. Set a delegate and subscribe to player state:

    appRemote.playerAPI.delegate = self;
    
    [appRemote.playerAPI subscribeToPlayerState:^(id  _Nullable result, NSError * _Nullable error) {
        // Handle Errors
    }];
    - (void)playerStateDidChange:(id<SPTAppRemotePlayerState>)playerState
    {
        NSLog(@"Track name: %@", playerState.track.name);
    }

Frequently Asked Questions

Why does music need to be playing to connect with SPTAppRemote?

Music must be playing when you connect with SPTAppRemote to ensure the Spotify app is not suspended in the background. iOS applications can only stay active in the background for a few seconds unless they are actively doing something like navigation or playing music.

Is SpotifyiOS.framework thread safe?

No, the framework currently expects to be called from the main thread. It will offload most of its work to a background thread internally but callbacks to your code will also occur on the main thread.

What if I need to authorize without starting playback?

There is an alternative authorization method. You can find more information about that here.

Comments
  • Spotify app v8.5.22: appRemote connects, but delegate methods not called, also appRemote.playerAPI = nil

    Spotify app v8.5.22: appRemote connects, but delegate methods not called, also appRemote.playerAPI = nil

    Please can anyone confirm that they can consistently receive calls to the delegate method appRemoteDidEstablishConnection after connecting with appRemote with the Spotify app v8.5.22 ??

    Or confirm that they consistently can't, like it is my case.

    Sometimes (rarely) appRemoteDidEstablishConnection gets called, but then the next time I run the app, it does not anymore.

    Spotify app v8.5.22 seems to have broken something in the iOS Spotify SDK/API

    This happens on my app and also on the latest NowPlayingView app from the demo projects.

    Here’s my experience:

    Noticed my app didn’t connect to the Spotify app on my iPhone.

    Noticed the Spotify app got updated to v8.5.22 on my iPhone.

    Tried to run my app on my iPad, it did connect.

    Noticed that the Spotify app on my iPad had not been updated yet.

    Updated the Spotify app on my iPad to version 8.5.22.

    Now my app doesn't connect to the Spotify app on my iPad.

    Spend the next 4 hours trying to find the bug. Can’t know exactly what’s happening but these are my findings so far:

    The appRemote seem to connect, it logs AppRemote: Established a connection to the Spotify app.

    But the delegate methods don’t get called: appRemoteDidEstablishConnection didFailConnectionAttemptWithError didDisconnectWithError, none of those methods ever get called.

    Also, even after appRemote.isConnected returns true, appRemote.playerAPI appRemote.userAPI appRemote.imageAPI appRemote.contentAPI, all of those equal nil

    Also tried to call appRemote.disconnect(), then appRemote.connect(), same situation

    I’m running the latest NowPlayingView project with the latest SDK (just downloaded it a few hours ago), running iOS 12.4.1

    Other users seem to have encountered the same problem: issues #149 (now closed but not solved) and #114 (down to the most recent comments).

    Thanks for reading this long post!

    opened by rugoso 36
  • spotify for iOS version 8.4.91 released 2/2/19 broke SPTLoginSampleSwift

    spotify for iOS version 8.4.91 released 2/2/19 broke SPTLoginSampleSwift

    The new release of Spotify was auto-loaded onto my phone overnight. Took me a couple hours to determine this broke the example. Can you please provide a working update.

    bug 
    opened by appsird 33
  • AppRemote Connect Fail

    AppRemote Connect Fail

    Hi Spotify,

    I'm having an issue with AppRemote.connect(). Sometimes after a successful SessionManager didInitiate I try to set the appremote.accesstoken and then appremote.connect but after redirecting to the Spotify and back to my app I receive this:

    Spotify didFailConnectionAttemptWithError Optional(Error Domain=com.spotify.app-remote Code=-1000 "Connection attempt failed." UserInfo={NSLocalizedDescription=Connection attempt failed., NSUnderlyingError=0x282a1c0f0 {Error Domain=com.spotify.app-remote.transport Code=-2000 "Stream error." UserInfo={NSLocalizedDescription=Stream error., NSUnderlyingError=0x282a1c090 {Error Domain=NSPOSIXErrorDomain Code=61 "Connection refused" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, NSLocalizedRecoverySuggestion=Reconnect the transport to the Spotify app., NSLocalizedFailureReason=A stream error has occured in the transport.}}, NSLocalizedRecoverySuggestion=Ensure the Spotify app is installed, and try to reconnect., NSLocalizedFailureReason=Could not connect to the Spotify app.})

    Even though I am currently listening to music in the Spotify App. I have set the configuration.playURI to "" and I have the requested scope to be: .appRemoteControl, .playlistReadPrivate. I'm testing with Xcode 10.2 and an iPhone X with 12.1.4

    If I restart Spotify I am able connect again, and this only seems to happen once a day or so.

    Any suggestions for further debugging or solutions would be greatly appreciated.

    Thank you!

    opened by aroe01 31
  • Existing iOS SDK – Playlist Access is Broken (401 error – Invalid Playlist URI)

    Existing iOS SDK – Playlist Access is Broken (401 error – Invalid Playlist URI)

    Issue Type: Bug Spotify iOS SDK Version: Beta 25 User Impact: Severe Reproducibility: 100% (first observed 9/11/2018 8:00am CDT)

    When passing in a playlist URI given by a SPTPartialPlaylist object to a request for promotion to a PlaylistSnapshot object, a 401 error is returned and users cannot view their playlist tracks, play songs from their playlists, or add and remove tracks. Along with the 401, an error reason of "Invalid Playlist URI" is given.

    Example of URI provided by SPTPartialPlaylist: "spotify:playlist:0tLwSYR5m7BxP9uxKHfhK1" Broken SDK method call: [SPTPlaylistSnapshot playlistWithURI: accessToken: market: callback: ]

    Error output obtained in the callback block: Error Domain=com.spotify.ios-sdk Code=401 "Invalid Playlist URI" UserInfo={NSLocalizedDescription=Invalid Playlist URI}

    Judging by the changes to this GitHub project, I can tell that no work continues on the 2014-2018 'iOS SDK'. However, this is still where developer.spotify.com points developers to to report issues with the existing iOS SDK (as well as the new Remote SDK). Any help resolving this would be appreciated– hundreds of active Premium users in production are potentially affected by this issue today.

    Thanks in advance!

    bug 
    opened by zackfletch00 18
  • appRemoteDidEstablishConnection not being called

    appRemoteDidEstablishConnection not being called

    Currently trying to migrate to this SDK from the prev. streaming one. Having a lot of trouble figuring out a particular issue re: appRemote delegate. I followed the Quick Start guide, have verified that the session successfully inits, and also see these logs...

    AppRemote: Connecting... AppRemote: Established a connection to the Spotify app.

    ...however none of the appRemote delegate methods are being called. I have set appRemote.delegate = self within my main AppDelegate, and have implemented all the req. delegate methods.

        func appRemoteDidEstablishConnection(_ appRemote: SPTAppRemote) {
            print("connected!", playerRemote != nil, playerRemote?.playerAPI != nil) // DOES NOT PRINT
            playerRemote?.playerAPI?.subscribe(toPlayerState: { (success, error) in
                print(success, error)
            })
        }
        
        func appRemote(_ appRemote: SPTAppRemote, didDisconnectWithError error: Error?) {
            print("disconnected!", error) // DOES NOT PRINT
            sptSessionManager?.renewSession()
        }
        
        func appRemote(_ appRemote: SPTAppRemote, didFailConnectionAttemptWithError error: Error?) {
            print("failed!", error.debugDescription) // DOES NOT PRINT
        }
    

    For reference, here is the rest of the setup:

    
        // MARK: Application Delegate
    
        func initializeSpotify() {
            sptConfiguration = SPTConfiguration(clientID: "###", redirectURL: URL(string: "###")!)
            sptConfiguration!.tokenRefreshURL = URL(string: "###")!
            sptConfiguration!.tokenSwapURL = URL(string: "###")!
            sptConfiguration!.playURI = ""
            sptSessionManager = SPTSessionManager(configuration: sptConfiguration!, delegate: self)
            playerRemote = SPTAppRemote(configuration: sptConfiguration!, logLevel: .debug)
            **playerRemote!.delegate = self**
            
            let requestedScopes: SPTScope =  [.appRemoteControl] // .streaming?
            
            if #available(iOS 11.0, *) {
                sptSessionManager!.initiateSession(with: requestedScopes, options: .default)
            } else {
    //            sptSessionManager!.initiateSession(with: requestedScopes, options: .default, presenting: <#T##UIViewController#>)
            }
        }
    
        func applicationDidBecomeActive(_ application: UIApplication) {
            if let _ = playerRemote?.connectionParameters.accessToken {
                // successfully reaches here and connects, resetting delegate to be extra sure (doesn't work either way)
                playerRemote!.delegate = self
                playerRemote?.connect()
            }
        }
        // MARK: SPTSessionManager Delegate
        
        func sessionManager(manager: SPTSessionManager, didInitiate session: SPTSession) {
            print("successfully init spt session", playerRemote != nil) // prints true
            playerRemote!.connectionParameters.accessToken = session.accessToken
        }
        
        func sessionManager(manager: SPTSessionManager, didFailWith error: Error) {
            print("failed to init spt session", error) // DOES NOT PRINT
            sptSessionManager?.renewSession()
        }
        
        func sessionManager(manager: SPTSessionManager, didRenew session: SPTSession) {
            print("renewed spt session", session) // DOES NOT PRINT
        }
    

    My thoughts were maybe it had something to do with the way I was initializing the var globally? I am running this on Xcode 10.1 Beta on a physical iPhone X running iOS 12 with Spotify installed. Could this be an issue?

    opened by vikasnair 15
  • Change Spotify's audio stream volume

    Change Spotify's audio stream volume

    In the previous SDK we had fine control over Spotify's volume with SPTAudioStreamingController. I'm not sure if this is possible with the new Remote SDK?

    suggestion 
    opened by JCardenete 13
  • Spotify iOS SDK play specific track from playlist.

    Spotify iOS SDK play specific track from playlist.

    I have been building a music app which integrates Spotify SDK in iOS. every thing is working fine but the problem is when I have to play a specific song from a playlist by clicking on that song I am unable to do that and song doesn't play, even I can retrieve information about that specific song but unable to play. I am using the Spotify iOS SDK version 1.0.2

    opened by Farrukh-Salman 11
  • Spotify demo Objective-c login without Spotify App

    Spotify demo Objective-c login without Spotify App

    With demo provide in the new SDK for objective-c if the phone has Spotify app install it works well but if the phone doesn't have the app Spotify installed I am having the error:

    "INVALID_CLIENT: Invalid redirect URI"

    the option is set to: SPTDefaultAuthorizationOption

    On the dashboard Redirect URIs is set: spotify-login-sdk-test-app://spotify-login-callback

    On the dashboard Bundle IDs is set: com.spotify.sdk.SPTLoginSampleApp

    On the app static NSString * const SpotifyRedirectURLString = @"spotify-login-sdk-test-app://spotify-login-callback";

    URL Schemes: spotify-login-sdk-test-app

    ruby file CLIENT_CALLBACK_URL = "spotify-login-sdk-test-app://spotify-login-callback"

    Did I forget something?

    question 
    opened by tiagomendesEye 11
  • Feature requests: working with playlists

    Feature requests: working with playlists

    First off, just want to say that this SDK has been great to work with, and it's awesome that Spotify offers an SDK to build on top of an already great product! Appreciate all of the work that has gone into building & maintaining this.

    One thing that is critical to my use of this SDK that is missing, however, is the ability to work with specific playlists. In the application I'm building, I need to (1) display a (known) subset of playlists from the list of all the user’s playlists, and (2) when the user chooses a playlist, play that playlist starting at a particular song/index in that playlist. There are a couple of challenges with both tasks in the current SDK, and I’d love to request some features to help with this!

    Challenge: Getting a list of user’s playlists is clunky

    The best way that I’ve found so far to get a list of a user’s playlists requires traversing a tree of content items through 3 calls in succession of -fetchRootContentItemsForType:callback: and -fetchChildrenOfContentItem:callback:. Essentially, I start with a -fetchRootContentItemsForType with the default type, scan the results for a “Your Library” content item, use that item as the parameter for -fetchChildrenOfContentItem, scan those results for a “Playlists” content item, and then use that as the parameter for a final -fetchChildrenOfContentItem call. While this process does work, it feels a little risky because it depends on a predictable title and/or URI pattern for the “Your Library” and “Playlists” content items - if Spotify ever changes those, then the code that traverses the tree would break.

    Alternatively, I could query the web API for playlists, but then I wouldn’t be able to take advantage of the offline functionality of this SDK, and also, that would not give me a full-fledged SPTAppRemoteContentItem object which is needed for the -playItem:skipToTrackIndex:callback: method.

    Proposed Solution

    Add a new -fetchContentItemsForType:callback: method spec to the SPTAppRemoteContentAPI protocol that can directly query lists of content items for things like playlists in a user’s library (but could also work for other types, such as albums/artists/podcasts in a user’s library, or the home/browse/recently played items). The SPTAppRemoteContentTypes can be expanded to support these additional types, or a new enum could be created for these queries.

    Challenge: No way to get all of a user’s playlists

    Even after following the above method to get a list of playlists, it only gets maximum 20 child content items from the user’s playlists, and it doesn’t seem like there’s a way to get more. If the specific playlists that I’m looking to display to the user are outside of their first 20 in their ordering, then there’s no way that I can display these playlists. Again, querying the web API isn’t an option for the same reasons as above.

    Other issues referencing this: #109

    Proposed Solution

    Add a paging mechanism to the -fetchChildrenOfContentItem method. In simplest form, that could just be adding an offset parameter to the method.

    Challenge: Playing an item from a particular index requires an SPTAppRemoteContentItem object

    The -playItem:skipToTrackIndex:callback: method works great, but it requires passing in an SPTAppRemoteContentItem object as a parameter. Given the first 2 challenges, it’s clunky at best to get that object, and at worst it’s impossible for any playlist outside of a user’s first 20.

    Alternatively, it’s possible to use the -play:callback: method using the playlist’s URI, but that doesn’t allow the capability to start at a specific index. I could follow the -play call with a bunch of -skipToNext calls until I’m at the right index, but that seems pretty clunky too... what if there are hundreds or thousands of songs on the playlist?

    Other issues referencing this: #113, #63, #41

    Proposed Solution(s)

    If the first 2 challenges are addressed, then no solution would be needed here… these would still help though!

    Add a -playURI:skipToTrackIndex:callback: method spec to the SPTAppRemotePlayerAPI protocol that can play a resource by URI starting at a particular track index.

    Also, add a -fetchContentItemForURI: method spec to the SPTAppRemoteContentAPI protocol that can fetch a SPTAppRemoteContentItem object directly from a URI. This would allow for checks for whether the item is playable and/or available offline if needed.

    suggestion 
    opened by hspinks 10
  • How to play chosen track in playlist and rest all the track played sequentially

    How to play chosen track in playlist and rest all the track played sequentially

    I am getting the playlist and playing it, and simultaneously showing all the tracks in a collection view. I want user can select any track and play it. After the track ends, the next song should start playing which happens in Spotify APP, but no API exposed to make an app work like that using SPotify SDK.

    To select a song I am enqueuing the selected track, and after getting the callback result calling playerAPI.skip(toNext:), this start playing the selected song but it's not the correct solution, as song ends it does not go to next song after that track.

    opened by shavik 10
  • NowPlayingDemo App OOTB failing to authenticate

    NowPlayingDemo App OOTB failing to authenticate

    Hi everyone,

    I've downloaded the Spotify SDK, and am just trying to run the demo app, NowPlayingView Demo project out of the box, and am having trouble connecting to Spotify.

    I do have Spotify premium, music is already playing when I build the app on XCode. I'm deploying my iPhone6. I'm able to see the "Spotify App Remote" view, but after tapping the "Play" button, it redirects me to my Spotify app, then redirects back and crashes. It fails on "didFailConnectionAttemptWithError."

    Here's the console log: 2019-01-03 16:40:55.739977-0500 NowPlayingView[45496:1889155] AppRemote: Connecting... 2019-01-03 16:40:55.814105-0500 NowPlayingView[45496:1889155] AppRemote: Established a connection to the Spotify app. 2019-01-03 16:40:55.985353-0500 NowPlayingView[45496:1889155] AppRemote: Failed to authenticate with the Spotify app. 2019-01-03 16:40:55.987605-0500 NowPlayingView[45496:1889155] AppRemote: Failed to establish a sesssion with error: Error Domain=com.spotify.app-remote.wamp-client Code=-1001 "wamp.error.authorization_failed" UserInfo={details={ message = "No token provided."; }, NSLocalizedFailureReason=wamp.error.authorization_failed} didFailConnectionAttemptWithError 2019-01-03 16:40:59.247482-0500 NowPlayingView[45496:1889155] AppRemote: Disconnected with error: (null)

    After extensive research, it looks like the access token is null, hence the failure to authenticate? I've also tried creating my own app in the developer portal, added in my own clientID and redirectURI.

    What am I missing?

    Thanks so much!

    opened by eanntuan 9
  • Apps using the spotify IOS SDK are suspended while in the background

    Apps using the spotify IOS SDK are suspended while in the background

    Shortly after going into the background my app is suspended by IOS At this point I have lost control over spotify playback Background mode capability is enabled in Xcode and the app store I have tried playing a silent audio using another audio package while playing tracks using the spotify SDK, making geolocation requests every 10 seconds, to no avail as the app is still suspended The spotify IOS SDK is not of use to me if I cannot control it while in the background This problem does not occur while using other audio streaming APIs. I would ask spotify to create a new streaming API to prevent this problem

    opened by rtessler 0
  • Spot

    Spot

    import UIKit

    /// Connection status view class ConnectionStatusIndicatorView : UIView {

    enum State {
        case disconnected
        case connecting
        case connected
    }
    
    var state: State = .disconnected {
        didSet {
            self.setNeedsDisplay()
            if state == .connecting {
                if displayLink == nil {
                    let selector = #selector(setNeedsDisplay as () -> Void)
                    displayLink = CADisplayLink(target: self, selector:selector)
                }
                displayLink?.add(to: RunLoop.main, forMode: RunLoopMode.commonModes)
            } else {
                displayLink?.remove(from: RunLoop.main, forMode: RunLoopMode.commonModes)
                displayLink = nil;
            }
        }
    }
    
    var displayLink: CADisplayLink?
    
    override func didMoveToSuperview() {
        super.didMoveToSuperview()
        self.clearsContextBeforeDrawing = true;
        self.backgroundColor = UIColor.clear
    }
    
    override func draw(_ rect: CGRect) {
        guard let context = UIGraphicsGetCurrentContext() else {
            return
    
    opened by Eladrian05 0
  • Is there a way to play (or keep playing) to external device

    Is there a way to play (or keep playing) to external device

    In the use case I am most interested in the user is actually using their phone to stream to another device (i.e. home stereo). If I set my spotify client up to be playing to that device and I try to authorize my iOS app I get the following error:

    TCP Conn 0x2838780b0 Failed : error 0:61 [61] 2022-12-06 16:51:08.709121-0800 Cyclops[1788:131885] AppRemote: Failed connection attempt with error: Error Domain=com.spotify.app-remote.transport Code=-2000 "Stream error." UserInfo={NSLocalizedDescription=Stream error., NSUnderlyingError=0x28012d2f0 {Error Domain=NSPOSIXErrorDomain Code=61 "Connection refused" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, NSLocalizedRecoverySuggestion=Reconnect the transport to the Spotify app., NSLocalizedFailureReason=A stream error has occured in the transport.}

    The Spotify app then resets the device to the local device. Ideally I'd love to have the devices exposed in through the SDK but at the very least I'd like to not change the playback device and have the phone continue to provide playback. Is there a way to accomplish this?

    opened by jfagans 0
  • No access token when when performing auth offline

    No access token when when performing auth offline

    When I get the access token and there is internet connection, I get a URL back in the following format

    my-app-name//spotify-login-callback/?spotify_version=8.7.84.360#access_token=ReallyLongAccessToken&token_type=Bearer&expires_in=3600

    If I run the same flow without internet connection, I get back the same thing, sans token.

    my-app-name://spotify-login-callback?spotify_version=8.7.84.360

    I was under the impression that as long as I have authenticated before on the device, I would be able to then authenticate offline. Was the Spotify app made incompatible with the SDK? Or is there a different way to go about offline auth

    opened by Aaron-Cohen 0
  • Calls to application(app, open: url, options: options) return false for error cases

    Calls to application(app, open: url, options: options) return false for error cases

    I'm seeing a lot of logs from our app about failing to handle requests to open Spotify URLs. The URLs in question are mostly along the lines of:

    • host://callback?error=user_canceled&error_description=user%20aborted&spotify_version=8.7.68.568
    • host://callback?error=unknown_error&error_description=error%20domain%3dcom.spotify.connectivity....
    • host://callback/?error=access_denied&spotify_version=8.7.68.568

    And when passing them to sessionManager.application(application, open: url, options: options) we're getting a return value of false which is misleading as these are URLs Spotify should handle. As a result we are then subsequently feeding the same URLs to all our other URL handling code, and eventually returning false to the OS which seems incorrect.

    Can someone verify if this is intended behavior, and if so why? And if it is not intended, is there a fix?

    opened by tinder-owenthomas 0
Releases(v1.2.2)
  • v1.2.2(Feb 17, 2020)

  • v1.2.1(Feb 11, 2020)

  • v1.2.0(Nov 20, 2019)

    What's New:

    • Adds support for connecting to Spotify when completely offline.
    • Adds a method to start playing radio from a URI.
    • Adds a method to get the content item object from a URI.
    Source code(tar.gz)
    Source code(zip)
  • v1.0.2(Apr 11, 2019)

    Spotify iOS SDK v1.0.2

    What's New

    • Adds a method to start playing a playlist from a given index
    • Adds a method to query the crossfade state (on/off) and duration
    Source code(tar.gz)
    Source code(zip)
  • v1.0.1(Dec 5, 2018)

    Spotify iOS SDK v1.0.1

    Important Note: The api for fetchRecommendedContentItemsForType: on SPTAppRemoteContentAPI has been renamed to fetchRootContentItemsForType: and still functions as it did returning root items. A new method for fetchRecommendedContentItemsForType:flattenContainers: has been added to fetch actual recommended items.

    What's new:

    • Adds convenience methods for dealing with podcasts
    • Adds additional convenience methods for fetching recommended items
    • Adds the ability to check if Spotify is active before authorization
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Sep 11, 2018)

  • AppRemote_Beta_v1.0.0(Sep 11, 2018)

    Spotify App Remote Beta SDK

    Note: This is a deprecated version of the beta SDK, use the iOS SDK (SpotifyiOS.framework) instead.

    What's New

    • Initial App Remote beta release
    Source code(tar.gz)
    Source code(zip)
Px-mobile-sdk-demo-app - PerimeterX Mobile SDK - Demo App

About PerimeterX PerimeterX is the leading provider of application security solu

PerimeterX 1 Nov 20, 2022
Alter SDK is a cross-platform SDK consisting of a real-time 3D avatar system, facial motion capture, and an Avatar Designer component built from scratch for web3 interoperability and the open metaverse.

Alter SDK is a cross-platform SDK consisting of a real-time 3D avatar system, facial motion capture, and an Avatar Designer component built from scratch for web3 interoperability and the open metaverse.

Alter 45 Nov 29, 2022
Native iOS implementation of RadarCOVID tracing client using DP3T iOS SDK

RadarCOVID iOS App Introduction Native iOS implementation of RadarCOVID tracing client using DP3T iOS SDK Prerequisites These are the tools used to bu

Radar COVID 146 Nov 24, 2022
TelegramStickersImport — Telegram stickers importing SDK for iOS

TelegramStickersImport — Telegram stickers importing SDK for iOS TelegramStickersImport helps your users import third-party programaticaly created sti

null 35 Oct 26, 2022
Muxer used on top of Feed iOS SDK for airplay

FeedAirplayMuxer Muxer used on top of Feed iOS SDK for airplay purposes. Demo Project --> https://github.com/feedfm/AirplayDemo Feed Airplay Muxer is

Feed Media 0 May 6, 2022
Basispay IOS SDK Version 2

BasisPay-IOS-KIT BasisPay IOS Payment Gateway kit for developers INTRODUCTION This document describes the steps for integrating Basispay online paymen

null 0 Oct 21, 2021
Release repo for Gini Bank SDK for iOS

Gini Bank SDK for iOS The Gini Bank SDK provides components for capturing, reviewing and analyzing photos of invoices and remittance slips. By integra

Gini GmbH 1 Dec 6, 2022
Da Xue Zhang Platform Lvb iOS SDK

Cloud_Lvb_SDK iOS API Reference Dxz Meeting iOS SDK是为 iOS 平台用户音视频服务的开源 SDK。通过大学长开放平台自研RTC,RTM系统,为客户提供质量可靠的音视频服务。 类 类名 描述 CLS_PlatformManager SDK的音视频主要

null 8 Jan 10, 2022
PayPal iOS SDK

PayPal iOS SDK Welcome to PayPal's iOS SDK. This library will help you accept card, PayPal, Venmo, and alternative payment methods in your iOS app. Su

PayPal 25 Dec 14, 2022
Unofficial Notion API SDK for iOS & macOS

NotionSwift Unofficial Notion SDK for iOS & macOS. This is still work in progress version, the module interface might change. API Documentation This l

Wojciech Chojnacki 59 Jan 8, 2023
150,000+ stickers API & SDK for iOS Apps.

English | 한국어 Stipop UI SDK for iOS Stipop SDK provides over 150,000 .png and .gif stickers that can be easily integrated into mobile app chats, comme

Stipop, Inc. 19 Dec 20, 2022
Headless iOS/Mac SDK for saving stuff to Pocket.

This SDK is deprecated Howdy all! ?? Thanks for checking out this repo. Your ?? mean a lot to us. ?? Unfortunately, this project is deprecated, and th

Pocket 230 Mar 18, 2022
Evernote Cloud SDK for iOS

Evernote Cloud SDK 3.0 for iOS This is the official Evernote SDK for iOS. To get started, follow the instructions bellow. Additional information can b

Evernote 256 Oct 6, 2022
iOS SDK for the Box Content API

Box iOS SDK Getting Started Docs: https://developer.box.com/guides/mobile/ios/quick-start/ NOTE: The Box iOS SDK in Objective-C (prior to v3.0.0) has

Box 112 Dec 19, 2022
OneDrive SDK for iOS

Get started with the OneDrive SDK for iOS Integrate the OneDrive API into your iOS app! 1. Installation Install via Cocoapods Install Cocoapods - Foll

OneDrive 101 Dec 19, 2022
Stripe iOS SDK

Stripe iOS SDK The Stripe iOS SDK makes it quick and easy to build an excellent payment experience in your iOS app. We provide powerful and customizab

Stripe 1.8k Jan 5, 2023
AWS SDK for iOS. For more information, see our web site:

AWS SDK for iOS The AWS SDK for iOS provides a library and documentation for developers to build connected mobile applications using AWS. Features / A

AWS Amplify 1.6k Dec 26, 2022
Zendesk Mobile SDK for iOS

⚠️ This Repository has been deprecated, please go to here for the Zendesk Support SDK ⚠️ Zendesk Mobile SDK for iOS Zendesk SDK for mobile is a quick,

Zendesk 113 Dec 24, 2022
PlayKit: Kaltura Player SDK for iOS

Kaltura Player SDK Demo: Demo repo. If you are a Kaltura customer, please contact your Kaltura Customer Success Manager to help facilitate use of this

Kaltura 77 Jan 3, 2023