Problem description
When trying to post something on the user's timeline using requestWithGraphPath, the call only works the first time (after authorize has been called). The following times, this error is returned:
{"type":"result","source":{},"error":"The operation couldn’t be completed. (facebookErrDomain error 10000.)","path":"me/feed","success":false,"graph":true}
Steps to reproduce
Use the following code to verify the problem (change [APPID]):
Ti.Facebook.appid = '[APPID]';
Ti.Facebook.permissions = ['publish_stream'];
var win = Ti.UI.createWindow({
background: 'white',
layout: 'vertical'
});
var button = Ti.UI.createButton({ title : 'fb login' });
button.addEventListener('click', function() {
Ti.Facebook.authorize();
});
var post = Ti.UI.createButton({ title : 'send post' });
post.addEventListener('click', postFeed);
Ti.Facebook.addEventListener('login', function(e) {
if (!e.success) {
alert('fb not logged in');
}
});
win.add(button);
win.add(post);
function postFeed() {
var fbData = {
caption : "Test report to FB",
message : "text to send to FB timeline from test iPhone app"
};
Ti.Facebook.requestWithGraphPath('me/feed', fbData, 'POST', function(ef) {
Ti.API.info(JSON.stringify(ef));
if (ef.error) {
alert(ef.error);
} else {
alert("upload to FB successful!");
}
});
}
win.open();
First time, clicking the send button (after login) works fine; then, it will never work again. Note that clicking again the login button won't fire the 'login' event anymore as well.
This is the full error coming from facebook. Error Domain=facebookErrDomain Code=10000 "The operation couldn’t be completed. (facebookErrDomain error 10000.)" UserInfo=0xa697b00 {error={ code = 506; "error_data" = { kError = 1455006; }; message = "(#506) Duplicate status message"; type = OAuthException; }} (#506) Duplicate status message means that you have posted a message in a small period of time from a previous one Switched the sample to change the message every time and the error went away. Going to mark this as wont fix.