Android Facebook应用请求

时间:2013-08-08 12:22:21

标签: android facebook facebook-app-requests

我在android中实现了Facebook应用程序请求。现在我能够向用户发送请求,但我的问题是,当用户从Facebook应用程序选择应用程序请求时,它会出现facebook错误。实际上我想要的是,当用户选择应用程序请求它重定向到应用程序或Android市场链接。在这里我附加了应用程序请求的屏幕和代码。请帮帮我。

请求代码:

             if(facebook.isSessionValid()) {
                 // A request showing how to send extra data that could signify a gift
                 Bundle params = new Bundle();
                 params.putString("message", "Learn how to make your Android apps social");
                 params.putString("title", "cRoNy Invite friends");
                 params.putString("data", 
                                  "{\"badge_of_awesomeness\":\"1\"," +
                                  "\"social_karma\":\"5\"}");

                 facebook.dialog(App.this, "apprequests", params, new DialogListener() {
                    @Override
                    public void onComplete(Bundle values) {
                        final String returnId = values.getString("request");
                        if (returnId != null) {
                            // Show the request Id if request sent successfully
                            Log.e("CD","Request Id : "+ returnId);
                            Toast.makeText(getApplicationContext(), 
                                            "Request sent: " +  returnId, 
                                            Toast.LENGTH_SHORT).show();
                        }
                    }

                    @Override
                    public void onFacebookError(FacebookError error) {
                        Log.e("CD","Facebook Error : "+ error);
                        Toast.makeText(getApplicationContext(), error.toString(), Toast.LENGTH_LONG).show();
                    }

                    @Override
                    public void onError(DialogError e) {
                        Log.e("CD","Facebook Error : "+ e);
                        Toast.makeText(getApplicationContext(), e.toString(), Toast.LENGTH_LONG).show();
                    }

                    @Override
                    public void onCancel() {
                        // Show a message if the user cancelled the request
                        Toast.makeText(getApplicationContext(), 
                                "Request cancelled", 
                                Toast.LENGTH_SHORT).show();
                    }
                 });
             } else {
                 // If the session is not valid show a message
                 Toast.makeText(getApplicationContext(), "You need to login to use send requests.", 
                        Toast.LENGTH_LONG).show();
             }

和Facebook错误消息:

enter image description here

0 个答案:

没有答案