Tag: spotify

从手机浏览器打开原生Spotify应用程序

是否可以在Android / iOS上的移动Web浏览器中单击指向用户configuration文件的链接,并打开Spotify本机应用程序。

CocoaLibSpotify会在login时将离线可用曲目重置为SP_TRACK_OFFLINE_WAITING

尝试保存我的播放列表以供离线使用时,我遇到了CocoaLibSpotify问题。 因此,我安装我的应用程序,第一次login,select一个播放列表,并将其设置为脱机使用,立即其offlineStatus更改为SP_PLAYLIST_OFFLINE_STATUS_DOWNLOADING,播放列表中的所有曲目都将其offlineStatus更改为SP_TRACK_OFFLINE_WAITING,他们开始一次下载一个并最终将其offlineStatus更改为SP_TRACK_OFFLINE_DONE。 我关掉了我的wifi,我可以离线播放下载的曲目。 当我closures应用程序并重新login时,以前可用的离线状态现在已将其offlineStatus更改为SP_TRACK_OFFLINE_WAITING,并且不能再离线播放。 CocoaLibSpotify存储下载的播放列表在NSCachesDirectory中,如果我检查文件夹,我看到内容没有改变,轨道数据仍然存在。 另一个奇怪的事情,我假设,即使在在线模式下,如果离线可用,CocoaLibSpotify将从设备播放下载的音轨。 如果我打开wifi,并开始播放这些以前下载的SP_TRACK_OFFLINE_WAITING音轨,然后快速closureswifi,它仍然继续播放整个音轨。 所以从外观来看,我假设曲目仍然保持离线状态,但由于某种原因,他们的offlineStatus在login时得到了错误的状态。而且会话由于其离线状态而拒绝开始播放曲目。 但是,如何避免离线状态重置的轨道,或者至less在我知道轨道已经下载的时候纠正这个问题。 我试过手动设置offlineStatus到SP_TRACK_OFFLINE_DONE,但是没有奏效。 我希望有人能够对此有所了解。 提前致谢。

CocoaLibSpotify几秒钟后播放崩溃

我遵循SimplePlayer示例项目,同时将其集成到我自己的testing项目中。 login和search曲目已经完美,但是当我尝试播放类似SimplePlayer的歌曲时,在EXC_BAD_ACCESS中的两个不同位置(请参见下图)上使用EXC_BAD_ACCESS播放1-2秒后会崩溃。 以下是开始播放的代码: SPTrack *track = [allTracks objectAtIndex:currentTrack]; [SPAsyncLoading waitUntilLoaded:track timeout:kSPAsyncLoadingDefaultTimeout then:^(NSArray *loadedItems, NSArray *notLoadedItems) { [playbackManager playTrack:track callback:^(NSError *error) { if (error) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Can't play Spotify Track" message:[error localizedDescription] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert show]; } else { spotifyTrack = track; } }]; }]; 注意:我通过Singleton模式处理自定义类SpotifyPlayer歌曲的播放。 任何帮助将不胜感激!

Spotify iOS SDK Swift显示所有(!)播放列表(20+)

我能够很容易地在Swift中获得前20个播放列表。 func getPlaylists() { //DispatchQueue.global(qos: .userInitiated).async { let playListRequest = try! SPTPlaylistList.createRequestForGettingPlaylists(forUser: session.canonicalUsername, withAccessToken: session.accessToken) Alamofire.request(playListRequest) .response { response in let list = try! SPTPlaylistList(from: response.data, with: response.response) for playList in list.items { if let playlist = playList as? SPTPartialPlaylist { let currentPlaylist: PlaylistItem = PlaylistItem(playlistName: playlist.name, playlistURL: playlist.uri.absoluteString) self.playlists.append(currentPlaylist) } } self.tableView.reloadData() } 到现在为止还挺好。 […]

Spotify:使用网页apilogin不接受redirecturl

我正在尝试使用Web APIlogin到Spotify,因为我不需要会话对象。 在我的授权方法中,我需要传入redirecturl,但格式化iOSredirecturl的方式在.GET请求中不被接受。 func authorize() { // create the url let url = "https://accounts.spotify.com/authorize" // parameters let parameters = ["client_id" : kClientID, "response_type" : "code", "redirect_uri" : "spotify-discover-login://callback", "state" : kState, "scope" : kScopes] // response code var responseCode = 401 Alamofire.request(.GET, url, parameters: parameters, headers: nil) .responseString{response in print(response) switch response.result { case .Success: […]

locking屏幕iPod控件无法使用Spotify音乐播放器

我将Spotify播放器添加到使用MPMusicPlayerController播放音乐的应用程序中。 当Spotify正在播放音乐并且屏幕被locking时,当用户在locking的屏幕上按下这些button时,远程控制事件不会被播放/暂停以及FFW / RWD接收。 如果从MPMusicPlayerController播放音乐,则可以根据以下代码接收遥控事件: -(void) ViewDidLoad { … [[UIApplication sharedApplication] beginReceivingRemoteControlEvents]; [self becomeFirstResponder]; … } 和 – (BOOL) canBecomeFirstResponder { return YES; } – (void) remoteControlReceivedWithEvent: (UIEvent*) event { // see [event subtype] for details if (event.type == UIEventTypeRemoteControl) { // We may be receiving an event from the lockscreen switch (event.subtype) { case […]

如何正确处理令牌刷新与Spotify SDK和Swift 3.错误代码= 3840

tl; dr我收到: JSON text did not start with array or object and option to allow fragments not set. 如果我试图收到一个令牌和No refresh token available in the session! 如果我试图更新令牌。 我试图在Swift 3中为Objective-C Spotify iOS SDK beta-25设置令牌刷新。我使用的是Heroku服务器,Spotify提供的Ruby脚本更改为我的凭据。 require 'sinatra' require 'net/http' require 'net/https' require 'base64' require 'encrypted_strings' require 'json' CLIENT_ID = ENV['xxx'] CLIENT_SECRET = ENV['xxx'] ENCRYPTION_SECRET = ENV['xxx'] CLIENT_CALLBACK_URL = […]

CocoaLibSpotify中的SPSearch

我正在看CocoaLibSpotify,并试图获得一个简单的search请求工作。 我这样做的请求: SPSearch *search = [[SPSearch alloc] initWithSearchQuery:@"Adele" inSession:[SPSession sharedSession] ]; 然后我在search返回: [search searchInProgress] 但我从来没有看到searchInProgress返回一个NO – 即。 search似乎永远不会完成。 我已经通过文档和示例进行了search,但它没有帮助我了解如何正确使用SPSearch – 肯定会在这里欢迎一些帮助… 谢谢,Iain

-canOpenURL:URL失败:“spotify:” – 错误:“(null)”

不知道如果这是真的,但从我读过的,人们说这个问题只发生在Xcode模拟器,所以你必须testing一个实际的设备。 这个问题是我目前的服务器是http://localhost:3000的本地节点服务器,我的iOS设备无法访问此服务器。 1)有没有办法让我的iOS设备访问我的设备上的本地服务器? 2)为什么我在运行模拟器时出现这个错误? 我把以下放在我的info.plist中: <key>LSApplicationQueriesSchemes</key> <array> <string>spotify</string> </array>

Spotify API for ios:下载,保存,访问来自ios spotify api的曲目

我想知道是否可以使用spotify ios api(CocoaLibSpotify IOS Library)下载到iphone / ipod / ipad设备的音轨。 如果是这样,我也需要访问他们,随时随地玩我想要的。 我将在以后的应用程序中使用它们。 我想我们可以使用sp_track_offline_status来检查正在播放的曲目的离线状态。 但我无法解决这个问题。 任何示例代码片段都将非常有帮助。 简化要求 :下载并保存到iOS设备的Spotify轨道 作为更新,为了响应iKenndac的回答,offlineStatus属性已经变为'1',这意味着该游戏者被同步用于本地存储。 SP_PLAYLIST_OFFLINE_STATUS_YES = 1,/// <播放列表同步到本地存储 1.这是否意味着播放列表中的所有曲目均已下载? 我不这么认为。 因为还有其他国家如下: typedef enum sp_playlist_offline_status { SP_PLAYLIST_OFFLINE_STATUS_NO = 0, ///< Playlist is not offline enabled SP_PLAYLIST_OFFLINE_STATUS_YES = 1, ///< Playlist is synchronized to local storage SP_PLAYLIST_OFFLINE_STATUS_DOWNLOADING = 2, ///< This playlist is currently […]