Change Facebook SDK request dialog title & notification title

半腔热情 提交于 2019-12-02 11:58:37

问题


this question is about android ... I have been a week for now trying to display my own message as a title for the invitation/request dialog and for the notification as well (for facebook SDK 3.0+) but i cant know how, and the facebook SDK documentation is a piece of !@#$, i must go through all the documentation from the start to know a little piece of information

here is my code

        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();

now 2 points :

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

and PLEASE dont tell me see the facebook documentation, it is a piece of !@#$


回答1:


Not sure if you can actually change the message for the notification. If you can find it in the documentation, it will tell you it's not possible (at least that's what I last came across). But you can change the title for the Dialog.

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


来源:https://stackoverflow.com/questions/23437559/change-facebook-sdk-request-dialog-title-notification-title

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!