我正在使用Unity和FB SDK。我正在尝试使用FB.Init,但我得到奇怪的行为,有时会调用来自FB.Init函数的回调,有时它会“停顿”或冻结而且永远不会被调用。我如何从该函数中捕获错误?我应该在初始化中设置超时吗?
public void Call(string methodName, params string[] args)
{
if (methodName != "init" && !Initialized)
{
Error("FbPluginManager not initialized.");
}
ReturnParams = null;
Global.Log(LogCat.PLUGINS, "Call: " + methodName);
switch (methodName)
{
case "init":
{
if (args.Length != 0 && !string.IsNullOrEmpty(args[0]))
{
FB.Init(OnInitComplete, args[0]);
}
break;
}
}
}
我有两个不同的网络播放器日志,唯一的区别在于:
这是FB.Init
的工作版本 Platform assembly: C:\Users\atolb\AppData\LocalLow\Unity\WebPlayer\mono\Release3.x.x\Data\lib\Mono.Security.dll (this message is harmless)
Non platform assembly: data-14D39E58 (this message is harmless)
UnloadTime: 0.574110 ms
System memory in use before: 47.5 MB.
Unloading 1 Unused Serialized files (Serialized files now loaded: 12 / Dirty serialized files: 0)
System memory in use after: 47.1 MB.
虽然来自FB.Init回调的非工作,不响应没有加载该.dll。