Pages

Saturday 30 April 2011

Publish MP3 files to Facebook User's Wall

Using the requestWithMethodName to publish your contents to your wall, so we need to send the json request to the facebook api.

 NSString *str = @"{'media': [{ 'type': 'mp3', 'src': 'http://www.looptvandfilm.com/blog/Radiohead%20-%20In%20Rainbows/01%20-%20Radiohead%20-%2015%20Step.MP3', 'title': '15 Step', 'artist': 'Radiohead', 'album': 'In Rainbows' }]}";             
NSMutableDictionary *params1 = [NSMutableDictionary dictionaryWithObjectsAndKeys: str, @"attachment" ,nil];
[appDelegate.facebook requestWithMethodName:@"stream.publish" andParams:params1 andHttpMethod:@"POST" andDelegate:self];
When your want to post to friend's wall using the user's ID

NSMutableDictionary *params=[NSMutableDictionary dictionaryWithObject:AudioUrl forKey:@"link"];

[params setObject:@"Your message to show in wall" forKey:@"message"]; //display the message
[params setObject:@"Description here" forKey:@"description"]; //description of ur post
[params setObject:@"any links you want to show" forKey:@"link"]; //post links
[params setObject:@"available URL of the Image" forKey:@"picture"]; //Post Picture
[appDelegate.facebook requestWithGraphPath:@"user'sID" andParams:params andHttpMethod:@"POST andDelegate:self];


0 comments:

Post a Comment

Feel Free to Share your Views