could not checkin on facebook from my iOS application - iphone

Recently Publishing a Checkin object is deprecated in favor of creating an Open Graph story with a location attached. You can also create a Post with a location attached using the 'publish_steam' extended permission.
I have posted checkin from my application by posting a story on timeline with the place id and it was working fine two days ago but now I am getting this error response
Error Domain=com.facebook.sdk Code=5 "The operation couldn’t be completed. (com.facebook.sdk error 5.)" UserInfo=0x1e5d03e0 {com.facebook.sdk:HTTPStatusCode=400, com.facebook.sdk:ParsedJSONResponseKey={
body = {
error = {
code = 1;
"error_data" = {
kError = 1455002;
};
message = "(#1) An unknown error occurred";
type = OAuthException;
};
};
code = 400;
}, com.facebook.sdk:ErrorSessionKey=<FBSession: 0x1f98cfd0, state: FBSessionStateOpenTokenExtended, loginHandler: 0x1f98d330, appID: 372278036211319, urlSchemeSuffix: , tokenCachingStrategy:<FBSessionTokenCachingStrategy:
Do anyone have the fix of this issue?

Related

Facebook's mobile open graph

I've recently heard that you don't have to create webpages for opengraph objects anymore and just post them from iOS app directly.
Having said that i've configured my Facebook app to be enabled for iOS only, but when i try posting OG object like that i get error:
NSMutableDictionary<FBOpenGraphObject> *object =
[FBGraphObject openGraphObjectForPostWithType:#"designdailyapp:item"
title:[NSString stringWithFormat:#"%# by %#", [currentObject objectForKey:#"Title"], [currentObject objectForKey:#"Designer"]]
image:#"https://s-static.ak.fbcdn.net/images/devsite/attachment_blank.png"
url:#"http://designdaily.me/site.html?id=111"
description:[currentObject objectForKey:#"Description"]];
[FBRequestConnection startForPostOpenGraphObject:object completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
NSString* resultID = [result objectForKey:#"id"];
//THIS IS WHERE I GET THE ERROR
if (!error) {
}
}];
This is the error i'm getting.
Error Domain=com.facebook.sdk Code=5 "The operation couldn’t be completed. (com.facebook.sdk error 5.)" UserInfo=0xc0a3ae0 {com.facebook.sdk:HTTPStatusCode=400, com.facebook.sdk:ParsedJSONResponseKey={
body = {
error = {
code = 100;
message = "(#100) Object Base Domain Not Allowed: Object at URL 'http://designdaily.me/site.html?id=111' of type 'designdailyapp:item' is invalid because the domain 'designdaily.me' is not allowed for the specified application id '477605465664930'. You can verify your configured 'App Domain' at https://developers.facebook.com/apps/477605465664930.";
type = OAuthException;
};
};
code = 400;
}, com.facebook.sdk:ErrorSessionKey=, expirationDate: 2013-12-08 15:28:35 +0000, refreshDate: 2013-10-09 15:28:35 +0000, attemptedRefreshDate: 0001-12-30 00:00:00 +0000, permissions:(
"user_friends",
installed,
"basic_info",
email,
"publish_actions"
)>}
I can get around it by configuring my Facebook app to also enable 'Website with Facebook login' and filling in domain field, but then i get rejected by not having a web site with Facebook login.
Anyone got mobile open graph to work?
thanks in advance!

Unable to publish custom story with mention tagging

My app was doing well yesterday and posting custom stories with mention tagging but from today its not working and telling me : -
Received Facebook error response of type OAuthException: Unknown path components: /mynamespace:customaction
Error code : 2500
{
"error": {
"message": "Unknown path components: /namespace:customaction",
"type": "OAuthException",
"code": 2500
}
}
$response = $facebook->api(
'me/mynamespace:customaction',
'POST',
array(
'treat' => "http://www.mywebsite.com/12321425125"
)
);
I have not changed any configurations or anything and it has stopped working all of a sudden. Please help me identify the issue - maybe there is an issue at Facebook end.

Facebook share via app loads two popups

The problem can be watched here
http://antipinagroup.com/collections/sac-de-voyage
On sharing via fb app ui loads two popups — feed dialogue and blank page.
Can't get the problem. Any ideas why it happens and how to resolve it?
The code for forming
objFB = {
method: 'feed',
link: document.location.href,
picture: fullPathImage + numimg +".jpg",
name: dataBl.title,
caption: dataBl.title,
description: dataBl['text description']};
_share = _share.replace(/href="javascript:;"/g, 'onclick="postToFeed(); return false;"' );
$( "." + mainBlockClass + " #overlay_" + mainBlockClass ).html( _share );
break;}});
(function(d){FB.init({appId: "151107748411463", status: true, cookie: true});}(document));
function postToFeed() { function callback(response) { /*console.log(response);*/ }FB.ui(objFB, callback);}
All I’m getting when I’m trying you FB share is
An error occurred. Please try again later.
API Error Code: 1
API Error Description: An unknown error occurred
Error Message: kError 1349040: Invalid App ID: The provided app ID is invalid.
I added &show_error=true at the end of the feed dialog URL your page creates as you can see, which is always (OK, make that most of the times) helpful to find errors with FB dialogs.
So first of all check your app id in your code.

Upload video to Facebook from the server

I have a problem when uploading videos to Facebook.
I use Facebook SDK for Android: https://github.com/facebook/facebook-android-sdk to get the access token with the following permissions: "publish_stream","email","video_upload","publish_actions"
Then I send token to the server, which should upload the video. The server tries to upload video using following code:
string fullurl = string.Format("https://graph-video.facebook.com/me/videos?title={0}&description={1}&access_token={2}", HttpUtility.UrlEncode(fileName), HttpUtility.UrlEncode(description), token);
Facebook returns an error:
System.Net.WebException: The remote server returned an error: (400) Bad Request.
at System.Net.WebClient.UploadFile(Uri address, String method, String fileName)
at System.Net.WebClient.UploadFile(String address, String fileName)
But, when I check token with the following link: https://graph.facebook.com/me?access_token=myToken Facebook returns user info. That means that token is valid. But, if this request returns error code, where I can find information about error codes?
This solution works perfectly for some users, for other users it works unstable ( 4 of 6 videos uploading failed. Facebook returns that: "connection closed by remote server"). And have not worked for some users with error: "The remote server returned an error: (400) Bad Request".
What is wrong in my code?
I've solve the problem. I have start using facebook SDK for .NET http://facebooksdk.net/ and it works for me.
Facebook.FacebookClient fb = new FacebookClient(facebookEditTask.facebookToken);
fb.PostCompleted += (o, e) =>
{
if (e.Cancelled || e.Error != null)
{
return;
}
var result = e.GetResultData();
facebookVideoUrl = CreateLinkToVideo(result.ToString());
};
dynamic parameters = new ExpandoObject();
parameters.source = new FacebookMediaStream
{
ContentType = "video/mp4",
FileName = Path.GetFileName(facebookEditTask.FilePath)
}.SetValue(File.OpenRead(facebookEditTask.FilePath));
parameters.message = fbMessage;
Task t = fb.PostTaskAsync("me/videos",
new { message = fbMessage, parameters.source });

getting OAUthException on FacebookMobile.login

i'm trying to login to facebook in order to share a link through facebook sharer
http://www.facebook.com/share.php?u=
i'm init the FacebookMobile on application start with no access token and than tries the below:
var facebookWebView:StageWebView = new StageWebView();
facebookWebView.viewPort = new Rectangle (0,0, stage.width, stage.height-100);
var permissions:Array = ["publish_stream"];
FacebookMobile.login(onfacebookLogin, this.stage, permissions, facebookWebView);
the login fails and show an execption on the flash builder 4.5 emulator:
{
"error": {
"message": "Error validating application.",
"type": "OAuthException"
}
}
anyone encountered it once?
Seems like your application missing some configuration.
Check the facebook app page properties.