我曾经有一种完美地在Facebook上发布Spotify歌曲的方法。
它们会看起来像从Mac或Windows版本的Spotify共享的任何其他链接。
现在,几个月过去了...我只能发布像www.domain.com这样的链接,但我不能再发布像http://open.spotify.com/track/4yLSpYlcO0jPPLTa3nW8zN这样的链接。
能否有人尝试发布上面的链接,并查看它是否出现为播放图标和专辑封面在他们的Facebook上? 我想知道是否Facebook已更改其API,使此不再可能? 我正在使用FBGraph。
结果应该看起来像这样(就像之前起作用):
http://voteplay.no/fbspotify.png
然而,现在当我使用Spotify网址时,我得到了以下错误:
抱歉,发生了一些错误。我们正在尽快修复。
更新
代码:
- (IBAction)facebookShare:(id)sender {
PartyQAppDelegate *delegate = (PartyQAppDelegate *)[[UIApplication sharedApplication] delegate];
facebook = [delegate facebook];
if (![facebook isSessionValid]) {
facebook.sessionDelegate = delegate;
NSArray *permissions = [[NSArray alloc] initWithObjects:@"read_stream", @"publish_stream",@"offline_access", nil];
[facebook authorize:permissions];
NSLog(@"SESSION NOT VALID!");
}else {
NSLog(@"SESSION VALID!");
NSString *trackurl = [self openSpotifyEncode:self.currentTrackPlaying];
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:trackurl, @"link",nil];
[facebook dialog:@"feed" andParams:params andDelegate:self];
}
}
- (NSString *)openSpotifyEncode:(NSString *)string {
NSString *encodedString = [NSString stringWithFormat:@"http://open.spotify.com/track/%@", [string substringFromIndex:14]];
return encodedString;
}
我已经解决了错误,不再需要任何帮助!感谢您告诉我它仍然在工作。(让我更加努力地查找错误)。
错误在appdelegate中代码的顺序上,但我仍然不知道为什么这会使我可以完美地发布所有其他链接,而不是spotify链接。
link:http://open.spotify...
) - Igy