Facebook应用程序错误显示一个用户而不是其他用户

Facebook App Error Showing Up For One User But Not Others

本文关键字:用户 一个 其他 错误 应用程序 显示 Facebook      更新时间:2023-09-26

我在Facebook画布中设置了一个Flash应用程序,它使用ExternalInterface调用JavaScript函数,然后在第一个函数完成时从JavaScript调用Flash函数:

Flash对象&var:

this.dBug.text += "'ngetting user albums...'n"
var usrAlbums:Array = new Array();
var pageLimit:Number = 48;
var pageOffset:Number = 0;
this.dBug.text += "'ttotal albums before call: " + usrAlbums.length + "'n";

回调函数:

this.dBug.text += "'tadding getAlbumResponse callback to ExternalInterface'n";
ExternalInterface.addCallback('getAlbumResponse', getAlbumResponse);
this.dBug.text += "'tcreating getAlbumResponse callback'n";
function getAlbumResponse(rtrn):void{
    dBug.text += "'nresponding to album get...'n";
    this.dBug.text += "'t't'tresult: " + rtrn['data'] + "'n";
    var album:Array = rtrn['data'];
    this.dBug.text += "'t'tadding objects to usrAlbums array...'n";
    for(prop in rtrn['data']){
        usrAlbums.push(new Array(album[prop], new Array()));
        this.dBug.text += "'t't'tadded " + album[prop] + ", new Array() to usrAlbums array'n";
        ++pageOffset;
        this.dBug.text += "'t't't'talbumCount:  " + pageOffset + "'n";
    }
    this.dBug.text += "'tcheck for more albums'n";
    if(pageOffset == pageLimit){
        getAlbum(++pageOffset, pageLimit);
    }else{
        this.dBug.text += "'t'ttotal albums after call: " + usrAlbums.length + "'n";
    }
}

ExternalInterface调用JavaScript函数:

function getAlbum(offset:Number, limit:Number){
    this.dBug.text += "'t'tcalling swfGetAlbum(/me/albums?offset=" + offset + "&limit=" + limit + ")...'n";
    ExternalInterface.call('swfGetAlbum', '/me/albums?offset=' + offset + '&limit=' + limit);
}

调用EI函数:

getAlbum(pageOffset, pageLimit);

Javascript在宿主页面:

function swfGetAlbum(graph){
    console.log('swfGetAlbum(' + graph + ')');
    FB.api(graph, function(response){ console.log(response); swfGetAlbumCallback(response); });
}
var swfGetAlbumCallback = function(response){
        console.log(response);
    console.log(document.getElementById('app-root'));
            document.getElementById('app-root').getAlbumResponse(response);
}

在我的Mac上,在我的Facebook账户下,在Chrome、Safari、Opera和Firefox上,一切都运行良好。它还可以在我测试PC上的相同浏览器下运行,此外还可以在Internet Explorer上运行。

由于某种原因,当我的朋友使用他的Facebook帐户测试应用程序时,当Javascript代码启动回调并试图运行document.getElementById('app-root'). getalbumresponse (response);时,他得到了一个错误。他在自己的电脑上用同样的浏览器进行测试,结果都一样。在Chrome下,错误读取为Uncaught error: error calling method on NPObject.

让事情变得更有趣;当他使用他的Facebook帐户在我的机器上测试应用程序时出现此错误,而当我使用我的Facebook帐户在他的机器上测试应用程序时不会发生此错误。

我还能在另外两个Facebook账户上测试这款应用。其中一个在我的Mac电脑上使用Safari浏览器,另一个在我朋友妻子的电脑上使用Chrome浏览器。这两个测试都没有错误。

此应用程序的Flash目标版本至少为v11(所有测试的机器/浏览器都有最新的Flash播放器),并使用swfobject 2插入页面。

我完全被这种行为搞糊涂了。有人遇到过这样的东西吗?

提前感谢!

我们甚至在黑暗中尝试了这个…

为了符合Facebook的https,我们在一个安全的服务器上。我们检查了我朋友的设置,发现https浏览设置没有被选中。再次检查后,一切正常。

相关文章: