我使用 iron.io 调用以下 parse.com 函数来获取我的用户朋友的 Facebook 详细信息。
var getDetailsForID = function (fbID) {
var thePromise = new Parse.Promise();
// TODO: maybe we can batch several users together into a single request................
console.log("Enter getDetailsForID");
FB.api('/v1.0', 'post', {
batch: [
{ method: 'get', name: 'basic', relative_url: fbID + '?fields=id,name,gender&include_headers=false', omit_response_on_success: false },
]
}, function(res) {
console.log("Enter callback in getDetailsForID");
if(!res || res.error) {
console.log(!res ? 'error occurred' : res.error);
return;
}
console.log(" getDetailsForID res: " + res);
thePromise.resolve(res);
});
console.log("Exit getDetailsForID");
return thePromise;
}
在 Iron.io 日志中,我看到:
Enter callback in getDetailsForID
[Error: 139994800940864:error:0607907F:digital envelope routines:EVP_PKEY_get1_RSA:expecting an rsa key:../deps/openssl/openssl/crypto/evp/p_lib.c:288:
以下不被调用:
console.log(" getDetailsForID res: " + res);
thePromise.resolve(res);
知道如何解决这个问题吗?