以下是如何在控制檯上獲得顯式結果的方法。
FBDialogs.PresentShareDialog(myAction,"altimeterthree:share","flight",(call, results, error) => {
if(call != null)show("Call = " + call.ToString());
if(results != null)Console.WriteLine("Results = "+results.ToString());
if(error != null)Console.WriteLine("Error = "+FBErrorUtility.UserMessage(error));
});
下面是控制檯輸出的樣子。注意結果也出現在通話信息中。
2014-05-11 10:09:26.067 AltimeterThree[18988:60b] Call = <FBAppCall: 0x19e02350, ID: 4589F102-3D11-40D5-BC95-1A1852B341AC
dialogData: <FBDialogsData: 0x19e04e20, method: ogshare
arguments: {
action = {
flight = {
data = {
};
description = "my description";
"fbsdk:create_object" = 1;
id = 1413672752238899;
image = (
{
url = "<UIImage: 0x147f9180>";
"user_generated" = true;
}
);
title = "Flight 23";
type = "altimeterthree:flight";
url = "http://http://samples.ogp.me/1413756595563848";
};
};
actionType = "altimeterthree:share";
previewPropertyName = flight;
}
results: {
completionGesture = cancel;
didComplete = 1;
}>
>
2014-05-11 10:09:26.070 AltimeterThree[18988:60b] Results = {
completionGesture = cancel;
didComplete = 1;
}
在您的第二個鏈接中有一個如何知道用戶是否取消共享的示例。 – giorashc
@giorashc是的,但是當代碼片段在設備上運行時,即使用戶實際共享內容,流程也不會到達成功塊,這就是很大的謎團。它總是進入'用戶取消'模塊。即使在該鏈接中的git倉庫中提供的示例代碼庫的行爲方式也完全相同。 –