Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try this to post youtube video</p> <pre><code>ACAccountStore *accountStore = [[ACAccountStore alloc] init]; ACAccountType *accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook]; [accountStore requestAccessToAccountsWithType:accountType options:@{ACFacebookAppIdKey : facebookAppKey, ACFacebookPermissionsKey : [NSArray arrayWithObjects:@"publish_stream", nil], ACFacebookAudienceKey : ACFacebookAudienceOnlyMe} completion:^(BOOL granted, NSError *error) { if(granted ) { NSArray *accountsArray = [accountStore accountsWithAccountType:accountType]; NSDictionary *postDict = @{ @"link": youtubeurl,//URL of youtube video }; ACAccount *facebookAccount = [accountsArray objectAtIndex:0]; SLRequest *facebookRequest = [SLRequest requestForServiceType:SLServiceTypeFacebook requestMethod:SLRequestMethodPOST URL:[NSURL URLWithString:@"https://graph.facebook.com/me/feed"] parameters:postDict]; [facebookRequest setAccount:facebookAccount]; [facebookRequest performRequestWithHandler:^( NSData* responseData, NSHTTPURLResponse* urlResponse, NSError* error ) { dispatch_async(dispatch_get_main_queue(), ^{ [self.view setUserInteractionEnabled:true]; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Posted Successfully on Facebook" message:@"" delegate:self cancelButtonTitle:@"Ok" otherButtonTitles: nil]; [alert show]; }); }]; } else { NSLog(@"Error %@", error.description); dispatch_async(dispatch_get_main_queue(), ^{ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Account not found" message:@"Please log in to Facebook account from Settings" delegate:self cancelButtonTitle:@"Ok" otherButtonTitles: nil]; [alert show]; }); } }]; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload