簡體   English   中英

知道何時在iOS中關閉FBNativeDialogs

[英]Knowing when FBNativeDialogs is dismissed in iOS

我已經實現了FBNativeDialogs。 除了我想知道何時關閉FBNativeDialogs之外,一切都工作得很好。

我知道有處理程序,但是根據文檔( https://developers.facebook.com/docs/reference/ios/3.1/class/FBNativeDialogs/ FBShareDialogHandler)FBShareDialogHandler定義了一個處理程序,該處理程序將響應本機共享而被調用顯示對話框。 的確,在同一文檔的其他部分中,他們說關閉對話框時將調用同一處理程序。 經過一段時間的研究,我發現第一個陳述是正確的。

因此,我正在尋找一種方法來知道FBShareDialogHandler已被關閉。 我也嘗試過viewDidDisappear,但顯然沒有。

您在調用方法時設置處理程序,如下所示:

[FBNativeDialogs presentShareDialogModallyFrom:viewController initialText:@"Some text..." image:nil url:someUrl handler:^(FBNativeDialogResult result, NSError *error) {
            if (error) {

            } else {
                switch (result) {
                    case FBNativeDialogResultCancelled:
                        //The user has dismissed the dialog
                        break;
                    case FBNativeDialogResultSucceeded:
                        //The user shared
                        break;
                    case FBNativeDialogResultError:
                        //There was an error
                        break;
                }
            }
        }];

在您發布的文檔url的末尾閱讀...處理程序FBShareDialogHandler與FBNativeDialogResult枚舉一起調用。 它列出了FBNativeDialogResultSucceeded,FBNativeDialogResultCancelled,FBNativeDialogResultError,所以我想它也會在關閉時調用

(添加)...好吧,您已經嘗試過了

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM