Issue
Android is not able to tag an image multiple times. If the image is posted first is successfully published to Facebook.
To reproduce
Run code below, authenticate through out Facebook and check out one's wall
Snippet code
Titanium.Facebook.appid = "417551948276805";
var myTags = [{
'to' : '100001066955730',
'tag_text' : 'y',
'x': 46.6667,
'y': 63.5556
}, {
'to': '1558224573',
'tag_text': 'x',
'x': 44.4444,
'y': 60.8889
}];
//tags: [{"id":"100001066955730", "x": 46.6667, "y": 63.5556}, {"id":"1558224573", "x": 42.6667, "y": 60.5556}]
function showRequestResult(e){
if (e.success) {
var ok = "Success! From FB: " + e.result;
var photo_id = JSON.parse(e.result);
alert(photo_id.id + ' @ '+photo_id.post_id);
Ti.Facebook.requestWithGraphPath( photo_id.id +'/tags?tags=', myTags, 'POST', showRequestResult);
} else {
if (e.error) {
alert(e.error);
} else {
alert("Unkown result");
}
}
}
// First make sure this permission exists
Titanium.Facebook.permissions = ['publish_stream', 'read_stream'];
Ti.Facebook.authorize();
// Now post the photo after you've confirmed that authorize() succeeded
var f = Ti.Filesystem.getFile('ScrollableView.jpg');
var blob = f.read();
var data = {
message: 'This is an Image',
picture: blob,
};
Ti.Facebook.requestWithGraphPath('me/photos', data, 'POST', showRequestResult);
Stack trace - Razr OS 2.3.5
05-29 01:35:59.227: I/ALERT(12957): (KrollRuntimeThread) [6685,6685] 299437416817838 @ 100002547477374_299368723491374
05-29 01:35:59.337: E/TiJSError(12957): (main) [104,6789] ----- Titanium Javascript Runtime Error -----
05-29 01:35:59.337: E/TiJSError(12957): (main) [0,6789] - In app.js:22,19
05-29 01:35:59.337: E/TiJSError(12957): (main) [1,6790] - Message: Uncaught Error: interface not implemented
05-29 01:35:59.337: E/TiJSError(12957): (main) [0,6790] - Source: Ti.Facebook.requestWithGraphPath( photo_id.id +'/tags?tags=', myTags, 'P
05-29 01:35:59.360: E/V8Exception(12957): Exception occurred at app.js:22: Uncaught Error: interface not implemented
Facebook API ref
https://developers.facebook.com/docs/reference/api/photo/
Test App
Test app in the description is not usable out of the box. Use this instead for testing:Not sure why one would think this would work. * The documentation clearly states that the second argument of
requestWithGraphPath
is a dictionary object, not an array of dictionary objects. * I can't find anything in the referred-to facebook documentation that supports this. They do mention you can add tags by appending to the URL, but that's all I can see, and that's not what is being done here. * This test case is non-sensical. If the test happens to succeed, it keeps calling itself (via repeated callbacks toshowRequestResult
. * The original test case as given here would not work if you were _not_ already logged in. It ignores what happens withauthorize
and just immediately does the request. * Please include only complete test cases. The file named ScrollableView.jpg doesn't seem to be present here. Since the Facebook API call to add tags includes coordinates regarding where the tagged person is located in the photo, it *could* be relevant which photo/graphic to upload while testing. (i.e., who knows how Facebook reacts (success/failure?) if the coordinates you pass make no sense for the given photo? -- the test case shouldn't introduce variables like that.)Closing ticket as invalid.