Here's my code but I'm getting invalid publish_streem
. Is there a way to share on facebook without showing the stock dialog box in iOS?
ACAccountStore * AccountStore = [[ACAccountStore Alok] Init]; ACAccountType * facebookAccountType = [AccountStore Account TypepeakTypeEditifier: ACAquintType IdentifierFacebook]; // ACAccount * facebookAccount; // Specify the application ID and the permissions NSDictionary * option = @ {ACFacebookAppIdKey: @ "565048226932112", ACFacebookPermissionsKey: @ [@ "publish_stream", @ "publish_actions"], ACFacebookAudienceKey: ACFacebookAudienceFriends}; [AccountStore requestXSetTaxXide: FacebookAquintType option: Options complete: ^ (BULL THE NSIRR * ERROR) {if (D) {NSARA * Accounts = [AccountStore accounts with ACCITY type: Facebook account type]; } Else {UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @ "error" message: [NSString stringWithFormat: @ "% @", error] Rep: zero cancelationTenTital: @ "OK" button button: zero, zero ]; [Alerts show]; // NSLog (@ "error:% @", error); }}];
Use the Facebook graph API
< / Strong>
Reference:
// Note: Pre-fencing associated with Facebook posts, // unless that user first created in manual workflow The content of your application can be against // platform policies:
// Keep the dialogs together
NSMutableDictionary * parameter = [NSMutableDictionary dictionaryWithObjectsAndKeys: @ " Sharing Tutorial ", @" No "@," Make great social applications and get more installs. ", @" Captions ", @" Allow your users to share stories on Facebook using the iOSad. ", @" Details ", @ "Http://developers.facebook.com/docs/ios/share/", @ "link", @ "http://i.imgur.com/g3Qc1HN.png", @ "picture", zero]; // Request [FBRequestConnection startWithGraphPath: @ "/ me / feed" parameter: parameter HTTPMethod: @ "post" completionHandler: ^ (FBRequestConnection * connection, ID result, NSError * error) {if (error!) {// link successfully} Facebook posted on NSLog (@ "Result:% @", Results); } Else {// has an error, we need to see // to handle the error: https://developers.facebook.com/docs/ios/errors NSLog (@ "% @", error.description) ; }}];
No comments:
Post a Comment