2014-05-02 34 views
1

這個問題是關於android ...我已經過了一個星期,試圖顯示自己的消息作爲邀請/請求對話框的標題以及通知(用於facebook SDK 3.0+),但我不知道如何,而facebook SDK文檔是一塊!@#$,我必須通過所有文檔從一開始就知道一點信息更改Facebook SDK請求對話標題和通知標題

這裏是我的代碼

 final Bundle parameters = new Bundle(); 
     parameters.putString("app_id", /*app id*/); 
     parameters.putString("to", /*selected friends*/); 
     parameters.putString("message", /*a message displayed to the inviter*/); 
     WebDialog dialog = new WebDialog.RequestsDialogBuilder(
         this, Session.getActiveSession(), parameters) 
         .setOnCompleteListener(new OnCompleteListener() {/*what ever happens here */} 
         }).build(); 
     dialog.show(); 

現在2點:

1- i want to set the title of the request dialog, all i can see is "app requests" 
2- i want to change the message that appears in the notification for the receiver 

,並請不要告訴我,看到Facebook的文檔,它是一塊!@#$

回答

0

不知道你是否能真正改變消息的通知。如果你可以在文檔中找到它,它會告訴你這是不可能的(至少這是我最後碰到的)。但是你可以改變對話框的標題。

WebDialog dialog = new WebDialog.RequestsDialogBuilder(
        this, Session.getActiveSession(), parameters) 
        .setTitle("Whatever title you like") 
        .setOnCompleteListener(new OnCompleteListener() { 
         /*what ever happens here */ 
        }}).build(); 
dialog.show(); 
+0

會嘗試這個代碼,看看它是否適用於我或不...在此先感謝 –

+0

功能的setTitle只改變對話框的標題。你如何改變接收方出現的通知標題? –

+0

您無法更改接收者將看到的通知的標題。 FB使用自定義故事來定義這些,您可以定義圖形對象(用於故事)的顯示方式。他們也將自動由FB翻譯。 – StingRay5