Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9292] Android: Uncaught Error: interface not implemented

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2012-06-11T14:00:42.000+0000
Affected Version/sRelease 1.8.2, Release 2.0.1
Fix Version/sn/a
ComponentsAndroid
LabelsSupportTeam, core
ReporterEduardo Gomez
AssigneeBill Dawson
Created2012-05-28T23:45:41.000+0000
Updated2017-03-09T23:29:48.000+0000

Description

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/

Comments

  1. Bill Dawson 2012-06-11

    Test App

    Test app in the description is not usable out of the box. Use this instead for testing:
       var w = Ti.UI.createWindow({backgroundColor: "#444"});
       
       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'];
       
       function doTest() {
       	// Now post the photo after you've confirmed that authorize() succeeded
       	var f = Ti.Filesystem.getFile('KS_nav_ui.png');
       	var blob = f.read();
       			  
       	var data = {
       		message: 'This is an Image',
       		picture: blob,
       	};
       	Ti.Facebook.requestWithGraphPath('me/photos', data, 'POST', showRequestResult);
       }
        
       
        
       //Ti.Facebook.authorize();
       Ti.Facebook.addEventListener("login", function(e) {
       	if (e.success) {
       		doTest();
       	}
       });
       
       w.add(Ti.Facebook.createLoginButton());
       w.open();
       
  2. Bill Dawson 2012-06-11

    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 to showRequestResult. * The original test case as given here would not work if you were _not_ already logged in. It ignores what happens with authorize 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.)
  3. Lee Morris 2017-03-09

    Closing ticket as invalid.

JSON Source