iOS Log-in with LinkedInSDK - ios

I need to provide an authorization with LinkedIn for my app.
I set up my app by this tutorial:
https://developer.linkedin.com/docs/ios-sdk
Then, Try to LogIn using this method:
- (void)login:(UIViewController *)controller{
NSArray *permissions = [NSArray arrayWithObjects:LISDK_BASIC_PROFILE_PERMISSION, LISDK_EMAILADDRESS_PERMISSION, LISDK_W_SHARE_PERMISSION, nil];
[LISDKSessionManager createSessionWithAuth:permissions state:nil showGoToAppStoreDialog:YES successBlock:^(NSString *returnState) {
LISDKSession *session = [[LISDKSessionManager sharedInstance] session];
NSLog(#"Session LINKEDIN: %#", session.description);
NSString *url = [NSString stringWithFormat:#"https://api.linkedin.com/v1/people/~"];
if ([LISDKSessionManager hasValidSession]) {
[[LISDKAPIHelper sharedInstance] getRequest:url
success:^(LISDKAPIResponse *response) {
NSData* data = [response.data dataUsingEncoding:NSUTF8StringEncoding];
NSDictionary *dictResponse = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
NSLog(#"Authenticated user name : %# %#", [dictResponse valueForKey: #"firstName"], [dictResponse valueForKey: #"lastName"]);
} error:^(LISDKAPIError *apiError) {
NSLog(#"Error : %#", apiError);
}];
}
} errorBlock:^(NSError *error) {
NSLog(#"%s","error called!");
}];
}
My app requires to open LinkedIn app, when I enter there my LI login and password, it asks me to confirm my permissions, but then nothing happens.
What should I do to perform a correct authorization through LinkedIn?
(maybe, there is a way to do this with WebView as FB or Twitter?)
Thanks.

Please use this link for linkedin login
//http://www.theappguruz.com/blog/integrate-linkedin-sdk-in-ios

Figured out how to receive token using OAuth. Just did all the stuff followed by this tutorial!

Related

How to Facebook login without opening Facebook app?

I recently installed the app "mapstr" and when you choose Facebook login, you don't go through the Facebbok app, you just accept the permissions through a kind of alertView :
It's written in French and it says : "mapstr" wants to access your public profile and your friends list.
When I tap OK, I am just logged with Facebook : no app switching !
How do they do that ?
(I am developping in Swift 2.0)
I'm Mapstr founder ;)
It's a loginBehavior option in Facebook LoginManager (in iOS SDK) which is the "FBSDKLoginBehaviorSystemAccount" (you also have the app option and the web option)
If a user has configure his face boo account on its iPhone, the SDK will use it, if not it will try the app, and then the web.
The only drawback is that if the system account exists but is misconfigured it failed...
Sebastien
Its using the facebook Credentials saved in your iPhone settings to login through facebook. You will need to use accounts framework for that. Below is the sample code for the same.
-(void)facebook
{
ACAccountStore *accountStore;
accountStore = [[ACAccountStore alloc]init];
ACAccountType *FBaccountType= [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
NSDictionary *dictFB = [NSDictionary dictionaryWithObjectsAndKeys:kFACEBOOK_APPID,ACFacebookAppIdKey,#[#"email"],ACFacebookPermissionsKey, nil];
[accountStore requestAccessToAccountsWithType:FBaccountType options:dictFB completion:
^(BOOL granted, NSError *e) {
if (granted)
{
[self afterPermissionGranted:accountStore accountType:FBaccountType];
}
else
{
//Fail gracefully...
NSLog(#"error getting permission %#",e);
dispatch_async(dispatch_get_main_queue(), ^{
[self openSessionWithAllowLoginUI:YES];
});
}
}];
}
-(void)afterPermissionGranted:(ACAccountStore *)accountStore accountType:(ACAccountType *)FBaccountType{
NSArray *accounts = [accountStore accountsWithAccountType:FBaccountType];
//it will always be the last object with single sign on
if ([accounts count] == 0) {
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:#"" message:#"No Other Facebook Account Found" delegate:self cancelButtonTitle:#"OK" otherButtonTitles:nil];
[alert show];
}
else{
ACAccount *facebookAccount;
facebookAccount = [accounts lastObject];
ACAccountCredential *facebookCredential = [facebookAccount credential];
NSString *accessToken = [facebookCredential oauthToken];
NSLog(#"FAT: %#", accessToken);
NSURL *requestURL = [NSURL URLWithString:#"https://graph.facebook.com/me"];
SLRequest *request = [SLRequest requestForServiceType:SLServiceTypeFacebook requestMethod:SLRequestMethodGET URL:requestURL parameters:nil];
request.account = facebookAccount;
[request performRequestWithHandler:^(NSData *data, NSHTTPURLResponse *response, NSError *error) {
if(!error)
{
NSDictionary *list =[NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error];
NSDictionary *errorPart = [list objectForKey:#"error"];
NSString *errorsubCode =[NSString stringWithFormat:#"%#",[errorPart valueForKey:#"error_subcode"]];
if (![errorsubCode isEqualToString:#"(null)"]) {
dispatch_async(dispatch_get_main_queue(), ^{
[self openSessionWithAllowLoginUI:YES];
});
}
else{
NSString *globalmailID = [NSString stringWithFormat:#"%#",[list objectForKey:#"email"]];
NSLog(#"global mail : %#",globalmailID);
NSString *fbname = [NSString stringWithFormat:#"%#",[list objectForKey:#"name"]];
NSLog(#"fname %#",fbname);
ACAccountCredential *fbCredential = [facebookAccount credential];
NSString *accessToken = [fbCredential oauthToken];
[self saveDataFromFacebook:error user:list accessToken:(NSString *)accessToken];
}
}
else
{
//handle error gracefully
NSLog(#"error from get%#",error);
//attempt to revalidate credentials
}
dispatch_async(dispatch_get_main_queue(), ^{
[self endProgressBar];
});
}];
}
}
Please remove the extra code. Feel free to ask any queries.

Sharing a image URL and text in LinkedIn integration using sdk

In LinkedIn sharing,LinkedIn provide a SDK but using this SDK,I can't share image link and text it always shows
LISDKErrorAPIDomain Code=403 The operation couldn’t be completed. (LISDKErrorAPIDomain error 403.)
Code:
NSString *url = #"https://api.linkedin.com/v1/people/~/shares";
NSString *payload = #"{\"comment\":\"Check out developer.linkedin.com! http://linkd.in/1FC2PyG\",\"visibility\":{ \"code\":\"anyone\" }}";
if ([LISDKSessionManager hasValidSession])
{
[[LISDKAPIHelper sharedInstance] postRequest:url stringBody:payload
success:^(LISDKAPIResponse *response) {
// do something with response
NSLog(#"response : %#",response.data);
}
error:^(LISDKAPIError *apiError) {
// do something with error
NSLog(#"error: %#",apiError);
}];
}
Sharing on LinkedIn Error : LISDKErrorAPIDomain Code=403 The operation couldn’t be completed.
if you are repeating same static text to post on LinkedIn, it might be a change to getting same error.
you must get share permission before add post
NSArray *permissions = [NSArray arrayWithObjects:LISDK_BASIC_PROFILE_PERMISSION,LISDK_W_SHARE_PERMISSION, nil];
full login code
NSArray *permissions = [NSArray arrayWithObjects:LISDK_BASIC_PROFILE_PERMISSION,LISDK_W_SHARE_PERMISSION, nil];
[LISDKSessionManager createSessionWithAuth:permissions state:nil showGoToAppStoreDialog:YES successBlock:^(NSString *returnState){
NSLog(#"%s","success called!");
LISDKSession *session = [[LISDKSessionManager sharedInstance] session];
NSLog(#"Session : %#", session.description);
[[LISDKAPIHelper sharedInstance] getRequest:#"https://api.linkedin.com/v1/people/~"
success:^(LISDKAPIResponse *response) {
NSData* data = [response.data dataUsingEncoding:NSUTF8StringEncoding];
NSDictionary *dictResponse = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
NSString *authUsername = [NSString stringWithFormat: #"%# %#", [dictResponse valueForKey: #"firstName"], [dictResponse valueForKey: #"lastName"]];
NSLog(#"Authenticated user name : %#", authUsername);
} error:^(LISDKAPIError *apiError) {
NSLog(#"Error : %#", apiError);
}];
} errorBlock:^(NSError *error) {
NSLog(#"Error called : %#", error);
}];

In Facebook share I am unable to post name, linkDescription and picture on FBLinkShareParams on Facebook app installed condition

I want to post name, linkDescription and picture on FBLinkShareParams but I am unable able do that on Facebook app installed condition but It works fine in Facebook app not installed condition when it is done in FBWebDialogs. I was able to post params.link only in Facebook app installed condition.
I have used code as shown below:
#pragma mark - facebook share
//facebook share
- (void)shareLinkinFB{
/* Facebook app is installed*/
FBLinkShareParams *params = [[FBLinkShareParams alloc] init];
params.link = [NSURL URLWithString:#"https://developers.facebook.com/docs/ios/share/"];
params.name= #"Dieheart";
params.picture= [NSURL URLWithString:Str_KoolkatPic];
params.linkDescription=#"A quick and better way to get anything delivered at your doorstep. ";
// If the Facebook app is installed and we can present the share dialog
if ([FBDialogs canPresentShareDialogWithParams:params]) {
[FBDialogs presentShareDialogWithLink:params.link handler:^(FBAppCall *call, NSDictionary *results, NSError *error) { if(error) {
// An error occurred, we need to handle the error
NSLog(#"Error publishing story: %#", error.description);
} else {
// Success
NSLog(#"result %#", results);
}
}];
NSLog(#"Share login page Now");
} else {
/* Facebook app Not installed*/
NSLog(#"Share dialog");
NSString *urlString = [NSString stringWithFormat:#"%#/resources/images/login-logo.png",SERVER_ADDRESS];
NSString *Str_NameLabel;
NSString *Str_Description;
Str_NameLabel=#"testing for idelivery IOS application";
Str_Description=#"Share functionality in progress";
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
Str_NameLabel, #"name",
#"idelivery Town center", #"caption",
Str_Description, #"description",
#"https://www.facebook.com/edeliveryksa", #"link",
urlString, #"picture",
nil];
// Show the feed dialog
[FBWebDialogs presentFeedDialogModallyWithSession:nil parameters:params
handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
if (error) {
// An error occurred, we need to handle the error
// See: https://developers.facebook.com/docs/ios/errors
NSLog(#"Error publishing story: %#", error.description);
} else {
if (result == FBWebDialogResultDialogNotCompleted) {
// User cancelled.
NSLog(#"User cancelled.");
} else {
// Handle the publish feed callback
NSDictionary *urlParams = [self parseURLParams:[resultURL query]];
if (![urlParams valueForKey:#"post_id"]) {
// User cancelled.
NSLog(#"User cancelled.");
} else {
// User clicked the Share button
NSString *result = [NSString stringWithFormat: #"Posted story, id: %#", [urlParams valueForKey:#"post_id"]];
NSLog(#"result %#", result);
[self postSuccess]; // success vako condn ko lagi banako
}
}
}
}];
}}
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation {
BOOL urlWasHandled = [FBAppCall handleOpenURL:url
sourceApplication:sourceApplication
fallbackHandler:^(FBAppCall *call) {
NSLog(#"Unhandled deep link: %#", url);
// Here goes the code to handle the links
}];
return urlWasHandled;
}
// A function for parsing URL parameters returned by the Feed Dialog.
- (NSDictionary*)parseURLParams:(NSString *)query {
NSArray *pairs = [query componentsSeparatedByString:#"&"];
NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
for (NSString *pair in pairs) {
NSArray *kv = [pair componentsSeparatedByString:#"="];
NSString *val =
[kv[1] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
params[kv[0]] = val;
}
return params;
}
- (void)postSuccess{
NSLog(#" post success");
}
Hope any one would be able to help me
It looks like you're calling canPresentShareDialogWithParams: with the real params, but when it comes to actually presenting the dialog, you're calling it with a nil link, which is probably why nothing shows up.
You should call the presentShareDialogWithParams:clientState:handler: method with the params you created.
[FBDialogs presentShareDialogWithParams:params
clientState:nil
handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {...}];

Ios Facebook SDK how i can share an image,a link,a text?

I'm using the last facebook sdk in my ios app and i'm trying to share an image with a description and a link. I have tried
[FBDialogs presentShareDialogWithLink]
but i can't see my description text in the shared result. I have tried
[FBDialogs presentShareDialogWithPhotoParams]
but the description field of the FBPhotoParams is "onlyread" and i can't add any text. So i have abandoned the various fbdialogs and i have tried something that works in another my app:
if ([[FBSession activeSession] isOpen]) {
/*
* if the current session has no publish permission we need to reauthorize
*/
if ([[[FBSession activeSession] permissions]indexOfObject:#"publish_actions"] == NSNotFound) {
[[FBSession activeSession] requestNewPublishPermissions:[NSArray arrayWithObject:#"publish_actions"] defaultAudience:FBSessionDefaultAudienceFriends
completionHandler:^(FBSession *session,NSError *error){
[self share];
}];
}else{
[self share];
}
}else{
/*
* open a new session with publish permission
*/
[FBSession openActiveSessionWithPublishPermissions:[NSArray arrayWithObject:#"publish_actions"]
defaultAudience:FBSessionDefaultAudienceOnlyMe
allowLoginUI:YES
completionHandler:^(FBSession *session, FBSessionState status, NSError *error) {
if (!error && status == FBSessionStateOpen) {
[self share];
}else{
NSLog(#"error");
}
}];
}
Now this method not working and return me an error:
"OAuth \"Facebook Platform\" \"insufficient_scope\" \"(#200) The user hasn't authorized the application to perform this action\"";
I haven't the permission to share, but the user never see the permission dialog...Maybe i have to submit my application to Facebook for achive a "general" ublish_actions permission for my facebook app? It's only a link, i don't wanna send a build, wait an approvation,ecc.. Now it's really so complicated to share a link with an image and a text? There will be a simpler solution , i think... How i can do?
use this,
NSMutableDictionary *parameter = [NSMutableDictionary dictionaryWithObjectsAndKeys:
name, #"name",
author, #"caption",
linkShare, #"link",
userImage, #"picture",
nil];
[FBWebDialogs presentFeedDialogModallyWithSession:nil
parameters:parameter
handler:^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
if (error)
{
NSLog(#"Error publishing story: %#", error.description);
}
else
{
if (result == FBWebDialogResultDialogNotCompleted)
{
NSLog(#"User cancelled.");
}
else
{
NSDictionary *urlParams = [self parseURLParams:[resultURL query]];
NSLog(#"User login");
if (![urlParams valueForKey:#"post_id"])
{
NSLog(#"User cancelled post.");
}
else
{
NSString *result = [NSString stringWithFormat: #"Posted story, id: %#", [urlParams valueForKey:#"post_id"]];
NSLog(#"result %#", result);
}
}
}
}];
- (NSDictionary*)parseURLParams:(NSString *)query
{
NSArray *pairs = [query componentsSeparatedByString:#"&"];
NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
for (NSString *pair in pairs)
{
NSArray *kv = [pair componentsSeparatedByString:#"="];
NSString *val = [kv[1] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
params[kv[0]] = val;
}
return params;
}

How to share video in facebook SDK?

I wrote code as below where file exists in resources. Its not null.
I am successful in adding images, but stuck at videos.
-(void)uploadVideo {
NSLog(#"UPload Videio ");
NSString *filePath = [[NSBundle mainBundle] pathForResource:#"abc" ofType:#"mp4"];
NSError *error = nil;
NSData *data = [NSData dataWithContentsOfFile:filePath options:NSDataReadingUncached error:&error];
if(data == nil && error!=nil) {
//Print error description
NSLog(#"error is %#", [error description]);
}
NSLog(#"data is %#", data);
NSDictionary *parameters = [NSDictionary dictionaryWithObject:data forKey:#"sample.mov"];
if (FBSession.activeSession.isOpen) {
[FBRequestConnection startWithGraphPath:#"me/videos"
parameters:parameters
HTTPMethod:#"POST"
completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
// [FBRequestConnection setVideoMode:NO];
if(!error) {
NSLog(#"OK: %#", result);
} else
NSLog(#"Error: %#", error.localizedDescription);
}];
} else {
// We don't have an active session in this app, so lets open a new
// facebook session with the appropriate permissions!
// Firstly, construct a permission array.
// you can find more "permissions strings" at http://developers.facebook.com/docs/authentication/permissions/
// In this example, we will just request a publish_stream which is required to publish status or photos.
NSArray *permissions = [[NSArray alloc] initWithObjects:
#"publish_stream",
nil];
//[self controlStatusUsable:NO];
// OPEN Session!
[FBSession openActiveSessionWithPermissions:permissions
allowLoginUI:YES
completionHandler:^(FBSession *session,
FBSessionState status,
NSError *error) {
// if login fails for any reason, we alert
if (error) {
// show error to user.
} else if (FB_ISSESSIONOPENWITHSTATE(status)) {
// no error, so we proceed with requesting user details of current facebook session.
[FBRequestConnection startWithGraphPath:#"me/videos"
parameters:parameters
HTTPMethod:#"POST"
completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
// [FBRequestConnection setVideoMode:NO];
if(!error) {
NSLog(#"Result: %#", result);
} else
NSLog(#"ERROR: %#", error.localizedDescription);
}];
//[self promptUserWithAccountNameForUploadPhoto];
}
// [self controlStatusUsable:YES];
}];
}
}
In return I am getting error as
The operation couldn’t be completed. (com.facebook.sdk error 5.)
How to upload video to facebook using facebook iOS SDK?
Thanks
Here's a method to upload video to Facebook. This code is testing and 100% working.
ACAccountStore *accountStore = [[ACAccountStore alloc] init];
ACAccountType *facebookAccountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
// Specify App ID and permissions
NSDictionary *options = #{ACFacebookAppIdKey: FACEBOOK_ID,
ACFacebookPermissionsKey: #[#"publish_stream", #"video_upload"],
ACFacebookAudienceKey: ACFacebookAudienceFriends}; // basic read permissions
[accountStore requestAccessToAccountsWithType:facebookAccountType options:options completion:^(BOOL granted, NSError *e) {
if (granted) {
NSArray *accountsArray = [accountStore accountsWithAccountType:facebookAccountType];
if ([accountsArray count] > 0) {
ACAccount *facebookAccount = [accountsArray objectAtIndex:0];
NSDictionary *parameters = #{#"description": aMessage};
SLRequest *facebookRequest = [SLRequest requestForServiceType:SLServiceTypeFacebook
requestMethod:SLRequestMethodPOST
URL:[NSURL URLWithString:#"https://graph.facebook.com/me/videos"]
parameters:parameters];
[facebookRequest addMultipartData: aVideo
withName:#"source"
type:#"video/mp4"
filename:#"video.mov"];
facebookRequest.account = facebookAccount;
[facebookRequest performRequestWithHandler:^(NSData* responseData, NSHTTPURLResponse* urlResponse, NSError* error) {
if (error == nil) {
NSLog(#"responedata:%#", [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding]);
}else{
NSLog(#"%#",error.description);
}
}];
}
} else {
NSLog(#"Access Denied");
NSLog(#"[%#]",[e localizedDescription]);
}
}];
Recommendation:
I think this might be a permissions issue but I am not sure where the error is being thrown. The delegate method that would be thrown is not shown in your code. I think reconciling your code with the steps in this sample might be helpful; if so please accept the answer.
Some key aspects of the sample:
Permissions:
- (IBAction)buttonClicked:(id)sender {
NSArray* permissions = [[NSArray alloc] initWithObjects:
#"publish_stream", nil];
[facebook authorize:permissions delegate:self];
[permissions release];
}
Build Request:
- (void)fbDidLogin {
NSString *filePath = [[NSBundle mainBundle] pathForResource:#"sample" ofType:#"mov"];
NSData *videoData = [NSData dataWithContentsOfFile:filePath];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
videoData, #"video.mov",
#"video/quicktime", #"contentType",
#"Video Test Title", #"title",
#"Video Test Description", #"description",
nil];
[facebook requestWithGraphPath:#"me/videos"
andParams:params
andHttpMethod:#"POST"
andDelegate:self];
}
Request didLoad delegate method:
- (void)request:(FBRequest *)request didLoad:(id)result {
if ([result isKindOfClass:[NSArray class]]) {
result = [result objectAtIndex:0];
}
NSLog(#"Result of API call: %#", result);
}
Request didFail delegate method:
- (void)request:(FBRequest *)request didFailWithError:(NSError *)error {
NSLog(#"Failed with error: %#", [error localizedDescription]);
}
Facebook Video Permissions Link
This Code is Tested successfully On FaceBook SDK 3.14.1
Recommendation: In .plist
set FacebookAppID,FacebookDisplayName,
URL types->Item 0->URL Schemes set to facebookappId prefix with fb
-(void)shareOnFaceBook
{
//sample_video.mov is the name of file
NSString *filePathOfVideo = [[NSBundle mainBundle] pathForResource:#"sample_video" ofType:#"mov"];
NSLog(#"Path Of Video is %#", filePathOfVideo);
NSData *videoData = [NSData dataWithContentsOfFile:filePathOfVideo];
//you can use dataWithContentsOfURL if you have a Url of video file
//NSData *videoData = [NSData dataWithContentsOfURL:shareURL];
//NSLog(#"data is :%#",videoData);
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
videoData, #"video.mov",
#"video/quicktime", #"contentType",
#"Video name ", #"name",
#"description of Video", #"description",
nil];
if (FBSession.activeSession.isOpen)
{
[FBRequestConnection startWithGraphPath:#"me/videos"
parameters:params
HTTPMethod:#"POST"
completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
if(!error)
{
NSLog(#"RESULT: %#", result);
[self throwAlertWithTitle:#"Success" message:#"Video uploaded"];
}
else
{
NSLog(#"ERROR: %#", error.localizedDescription);
[self throwAlertWithTitle:#"Denied" message:#"Try Again"];
}
}];
}
else
{
NSArray *permissions = [[NSArray alloc] initWithObjects:
#"publish_actions",
nil];
// OPEN Session!
[FBSession openActiveSessionWithPublishPermissions:permissions defaultAudience:FBSessionDefaultAudienceEveryone allowLoginUI:YES
completionHandler:^(FBSession *session,
FBSessionState status,
NSError *error) {
if (error)
{
NSLog(#"Login fail :%#",error);
}
else if (FB_ISSESSIONOPENWITHSTATE(status))
{
[FBRequestConnection startWithGraphPath:#"me/videos"
parameters:params
HTTPMethod:#"POST"
completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
if(!error)
{
[self throwAlertWithTitle:#"Success" message:#"Video uploaded"];
NSLog(#"RESULT: %#", result);
}
else
{
[self throwAlertWithTitle:#"Denied" message:#"Try Again"];
NSLog(#"ERROR: %#", error.localizedDescription);
}
}];
}
}];
}
}
And I GOT Error:
The operation couldn’t be completed. (com.facebook.sdk error 5.)
It happens when facebook is being inited. Next time i open my app, it works fine, its always the first time. Tried everything in app, but it seems to be on the Facebook SDK side.
Few causes for seeing com.facebook.sdk error 5:
Session is is not open. Validate.
Facebook has detected that you're spamming the system. Change video name.
Facebook has a defined limit using the SDK. Try a different app.
Did you ask for a publish_stream permission before?

Resources