Facebook Graphics API: Share Sound

Is it possible to share audio using facebook graphic API

  • Is it possible to directly upload audio files to a facebook server, like a video?
  • Can I share the audio link on facebook and it will show the built-in player on facebook?

I tried this ios Facebook Graph API solution - publish an audio file but it does not work properly

I tried to transfer the audio link http://bit.ly/Ok4ZX6 , but I will show it on facebook, as a regular link with no built-in player http://i.stack.imgur.com/Ld67c.png

Edit

The code I'm using is:

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:4];
[params setObject:text forKey:@"message"];
[params setObject:title forKey:@"name"];
[params setObject:fileUrl forKey:@"source"];
[facebook requestWithGraphPath:@"me/feed" andParams:params andHttpMethod:@"POST" andDelegate:self];

This code is also used:

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:4];
NSString *attachment = [NSString stringWithFormat:@"{'media': [{'type': 'mp3', 'src': '%@', 'title': '%@'}], 'messgae': 'Messgae Messgae Messgae', 'name': 'Name Name Name', 'href': '%@'}",amazon_link, title, link];
[params setObject:attachment forKey:@"attachment"];
[params setObject:text forKey:@"message"];
[params setObject:@"stream.publish" forKey:@"method"];
[facebook requestWithParams:params andDelegate:self];
+5
source share
3 answers

? . , , , .

, "source" api, "link".

: http://developers.facebook.com/docs/reference/api/post/


API, . publish_stream.

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];
+2

Soundcloud og: , . SWF , . OG Debugger, .

, .

0

Try it like this .. His work is for me ..

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);
0
source

All Articles