问题描述
我在使用Trigger.io Forge时遇到问题,并从本机FB好友选择器UI获取回调。
此问题仅在iOS上显示,在Android上运行正常。
I'm having trouble with Trigger.io Forge and getting a callback from a native FB friend selector UI.The problem is only showing on iOS, works fine on Android.
在iPhone设备或模拟器上的催化剂中运行此代码会导致FB对话显示正确。
Running this code in catalyst on either iPhone device or simulator causes the FB dialogue to show correctly.
>forge.facebook.ui({
method: 'apprequests',
message: 'Hey'
}, function(a){console.log('success: '+JSON.stringify(a))}, function(error) {console.log('error:'+JSON.stringify(error))});
>undefined
>success: null
选择一些用户时发送请求对话关闭,但从不调用回调。以下显示在Forge调试日志中:
When selecting some users and sending the requests the dialogue closes, but the callback is never called. The following shows up in Forge debug log:
[DEBUG] Native call: {
[DEBUG] callid = "35938A56-CEEC-44E1-8742-889D273F6E9E";
[DEBUG] method = "facebook.ui";
[DEBUG] params = {
[DEBUG] "exclude_ids" = "";
[DEBUG] message = "invited you to play Halo 4";
[DEBUG] method = apprequests;
[DEBUG] };
[DEBUG] start = "1353579502.975";
[DEBUG] }
[DEBUG] Returning to javascript: {
[DEBUG] callid = "35938A56-CEEC-44E1-8742-889D273F6E9E";
[DEBUG] content = "<null>";
[DEBUG] status = success;
[DEBUG] }
[DEBUG] 2012-12-05 13:04:09.631 Forge[5110:c07] An instance 0x9dd3700 of class FBSessionManualTokenCachingStrategy was deallocated while key value observers were still registered with it. Observation info was leaked, and may even become mistakenly attached to some other object. Set a breakpoint on NSKVODeallocateBreak to stop here in the debugger. Here's the current observation info:
[DEBUG] <NSKeyValueObservationInfo 0x9dcad90> (
[DEBUG] <NSKeyValueObservance 0x9dd1300: Observer: 0x9de4680, Key path: accessToken, Options: <New: NO, Old: NO, Prior: YES> Context: 0x112ad4, Property: 0xc9a6fe0>
[DEBUG] <NSKeyValueObservance 0x9dbba50: Observer: 0x9de4680, Key path: expirationDate, Options: <New: NO, Old: NO, Prior: YES> Context: 0x112ad4, Property: 0xc9a0a60>
[DEBUG] )
我们尝试了Forge版本1.4,1.4.21,没有快乐。我认为它与回调内容= null有关。
We tried Forge version 1.4, 1.4.21, no joy. I presume it is something to do with the callback content = null.
感谢您的帮助。
UPDATE
詹姆斯,你是对的 - iPhone回调被调用,但响应总是为空。我希望收到一个包含FB用户ID和请求ID的对象。
UPDATEJames, you are correct - the iPhone callback is getting called, but the response is always null. I am expecting to receive an object with FB user IDs and request IDs.
供参考,Android正常运行,并返回:
For reference, Android is working correctly, and returns:
[DEBUG] Native call "facebook.ui" with task.params: {"method":"apprequests","message":"Hey"}
[DEBUG] Returning: {"content":{"to[0]":"100004602392907","request":"453015091412347",
"to[1]":"515252483"},
"status":"success",
"callid":"ED47AAB4-7A72-45A0-B0B3-0DADC9A75E9C"}
如果用户取消FB对话,则返回:
And if the user cancels the FB dialogue this is returned:
[DEBUG] Returning: {"content":{},"status":"success",
"callid":"256CB78F-3EE1-4BD7-8990-EDE26275D68F"}
推荐答案
此修复程序将包含在v1.4.23 Trigger.io平台版本中。
A fix for this will be included in v1.4.23 Trigger.io platform version.
您成功的回调将被调用(例如对于apprequests):
Your success callback will be invoked with (for apprequests for example):
{"request":"519074534448448","to[0]":"105000524002524"}
注意:您的成功回调仍会被调用如果用户点击取消: {}
将作为回调参数传递。
Note: your success callback will still be invoked if the user hits cancel: {}
will be passed as the callback parameter.
如果用户点击<$在左上角c $ c> x ,将调用您的失败回调。
If they hit the x
in the top-left corner, your failure callback will be invoked.
这篇关于在iOS上使用null调用forge.facebook.ui回调的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!