我正在尝试使用Trigger.io的facebook方法来显示朋友选择器。它显示正常但从不返回任何数据。
即使选择了朋友, response
始终为null
。 According to the Facebook docs它应该返回request
和to
字段,以便我可以捕获请求发送给谁。
以下是一些示例代码:
forge.facebook.ui({
method: 'apprequests',
title: 'Create Game',
message: 'I challenge you to a game!'
}, function(response) {
console.log('success response');
console.log(''+response); // As string because logging null errors Catalyst
});
为此,Catalyst输出
success response
null
Trigger Toolkit输出
[DEBUG] Native call: {
[DEBUG] callid = "F8446A0D-44AE-46E4-A587-16BEC78EE695";
[DEBUG] method = "facebook.ui";
[DEBUG] params = {
[DEBUG] message = "I challenge you to a game!";
[DEBUG] method = apprequests;
[DEBUG] title = "Create Game";
[DEBUG] };
[DEBUG] start = "1354655948.023";
[DEBUG] }
[DEBUG] Returning to javascript: {
[DEBUG] callid = "F8446A0D-44AE-46E4-A587-16BEC78EE695";
[DEBUG] content = "<null>";
[DEBUG] status = success;
[DEBUG] }
我做错了吗?或者该库无法正常工作?
更新,12/5/12
这似乎是iOS唯一的问题。它发生在iOS5和iOS6的iOS模拟器(和设备)上。但在Android模拟器上工作正常:
[DEBUG] Native call "facebook.ui" with task.params: {"method":"apprequests","title":"Create Game","message":"I challenge you to a game!"}
[DEBUG] Returning: {"content":{"to[0]":"1175220065","request":"349563028475745"},"status":"success","callid":"548FE13D-69D9-415B-9A94-762D9F7C64B1"}
答案 0 :(得分:2)
对此的修复将包含在v1.4.23 Trigger.io平台版本中。
您的成功回调将被调用(例如,对于apprequests):
{"request":"519074534448448","to[0]":"105000524002524"}
注意:如果用户点击取消,仍会调用您的成功回调:{}
将作为回调参数传递。
如果他们点击左上角的x
,则会调用您的失败回调。