Objective c Facebook图形API:音频共享

Objective c Facebook图形API:音频共享,objective-c,ios,facebook-graph-api,facebook-ios-sdk,Objective C,Ios,Facebook Graph Api,Facebook Ios Sdk,我可以使用facebook图形API共享音频吗 我可以像视频一样直接在facebook服务器上上传音频吗 我可以在facebook上共享音频链接并在facebook上显示嵌入式播放器吗 我已经尝试过这个解决方案,但没有达到预期效果 我尝试的是分享音频链接,但在facebook上像普通链接一样显示,而不是用嵌入式播放器 编辑 我使用的代码: 也使用了此代码: 你从那个链接中尝试了什么解决方案?发布你自己的代码。我还注意到你的音频链接不起作用,至少对我来说不是 我认为正确的方法是在GraphAP

我可以使用facebook图形API共享音频吗

  • 我可以像视频一样直接在facebook服务器上上传音频吗
  • 我可以在facebook上共享音频链接并在facebook上显示嵌入式播放器吗
我已经尝试过这个解决方案,但没有达到预期效果

我尝试的是分享音频链接,但在facebook上像普通链接一样显示,而不是用嵌入式播放器

编辑

我使用的代码:

也使用了此代码:


你从那个链接中尝试了什么解决方案?发布你自己的代码。我还注意到你的音频链接不起作用,至少对我来说不是

我认为正确的方法是在GraphAPI中使用“source”字段,而不是“link”

这是一个关于开发者参考的好页面:


要使用graph API上传视频,可以执行以下操作。您还需要获得发布流权限的授权

NSString * file = [[NSBundle mainBundle] pathForResource:@"video" ofType:@"mov"];
NSData * video = [NSData dataWithContentsOfFile:file];
NSMutableDictionary * dict = [NSMutableDictionary dictionaryWithObjectsAndKeys: 
         @"title", @"title",
         @"description", @"description",
         video, @"video.mov",
         @"video/quicktime", @"contentType",
     nil];
[facebook requestWithGraphPath:@"me/videos"
                     andParams:dict
                 andHttpMethod:@"POST"
                   andDelegate:self];

Soundcloud使用og:video标签显示嵌入式播放器。视频标签接受SWF文件,因此可以加载交互式音频播放器小部件。尝试使用查看标签


目前,这似乎是在共享内容时向玩家展示内容的唯一策略。

尝试这样做。。这对我有用

NSMutableDictionary *variables=[[NSMutableDictionary alloc]init];

//Posting audio file
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"Dookudu" ofType:@"mp3"];
FbGraphFile *file=[[FbGraphFile alloc]initWithData:[NSData dataWithContentsOfFile:filePath]];
[variables setObject:file forKey:@"file"];

FbGraphResponse *response=[fbgraph doGraphPost:@"me/videos" withPostVars:variables];
NSLog(@"response %@",response.htmlResponse);

我已经添加了有问题的代码。。是的,链接不起作用。甚至我也尝试了其他的工作链接,但结果是一样的。我希望任何一个都可以像视频一样直接上传到facebook服务器上。或者可以共享音频链接,并在facebook上显示嵌入式播放器。我可以在facebook上上传视频。。我这里的问题是关于音频后期虽然,看起来他们正在研究一个更好的解决方案:嘿,阿米特,你写道你可以在facebook上共享视频。。。你能告诉我你是怎么做到的吗?
NSString * file = [[NSBundle mainBundle] pathForResource:@"video" ofType:@"mov"];
NSData * video = [NSData dataWithContentsOfFile:file];
NSMutableDictionary * dict = [NSMutableDictionary dictionaryWithObjectsAndKeys: 
         @"title", @"title",
         @"description", @"description",
         video, @"video.mov",
         @"video/quicktime", @"contentType",
     nil];
[facebook requestWithGraphPath:@"me/videos"
                     andParams:dict
                 andHttpMethod:@"POST"
                   andDelegate:self];
NSMutableDictionary *variables=[[NSMutableDictionary alloc]init];

//Posting audio file
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"Dookudu" ofType:@"mp3"];
FbGraphFile *file=[[FbGraphFile alloc]initWithData:[NSData dataWithContentsOfFile:filePath]];
[variables setObject:file forKey:@"file"];

FbGraphResponse *response=[fbgraph doGraphPost:@"me/videos" withPostVars:variables];
NSLog(@"response %@",response.htmlResponse);