samedi 27 décembre 2014

[Q] Android with facebook SDK not working topic






Hello,

I'm currently developing an application that uses the facebook SDK. On the emulator everything goes fine but the problem is in the real device.

I've setup the Hashkeys, i previously received the error "Invalid hash key not found in the application" and successfully fixed it. But now i'm having another problem.

Whenever i click a button (which is intended to call the Facebook sdk) the facebook activity pops in and suddenly the facebook activity closes. Supposedly, it should appears the Facebook share window. Here's the code that i'm using on that button:


Code:


APP_ID = getString(R.string.facebook_app_id);
                fb = new Facebook(APP_ID);
                    fb.authorize(QuestionsActivity.this, new Facebook.DialogListener() {
                        @Override
                        public void onComplete(Bundle values) {
                            Bundle params = new Bundle();
                            params.putString("name","I need your help!");
                            params.putString("caption","Could you give me a help please?");
                            params.putString("description", labelQuestion.getText().toString() + " A)" + answerA.getText() + " B)" + answerB.getText() + " C)" + answerC.getText());
                            params.putString("picture", "link");
                            params.putString("link,"link");
                            fb.dialog(QuestionsActivity.this,"feed",params,new Facebook.DialogListener() {
                                @Override
                                public void onComplete(Bundle values) {
                                    ShowScoreIncrement(10);
                                    Log.d("DEBUGA","A");
                                }

                                @Override
                                public void onFacebookError(FacebookError e) {
                                    Log.d("DEBUGA","B");
                                }

                                @Override
                                public void onError(DialogError e) {
                                    Log.d("DEBUGA","C");
                                }

                                @Override
                                public void onCancel() {
                                    Log.d("DEBUGA","D");
                                }
                            });
                        }

                        @Override
                        public void onFacebookError(FacebookError e) {
                            Log.d("FB","Error" + e.getMessage());
                        }

                        @Override
                        public void onError(DialogError e) {
                            Log.d("FB", "Complete" + e.getMessage());
                        }

                        @Override
                        public void onCancel() {
                            Log.d("FB","Cancel");
                        }
                    });


As for logging info:


Code:


12-27 21:36:49.737    6220-6220/com.angelo.assassinscreedquiz I/Adreno-EGL﹕ <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LNX.LA.3.5.1_RB1.04.04.02.048.006_msm8610_LNX.LA.3.5.1_RB1__release_AU ()
    OpenGL ES Shader Compiler Version: E031.24.00.07
    Build Date: 02/12/14 Wed
    Local Branch:
    Remote Branch: quic/LNX.LA.3.5.1_RB1.1
    Local Patches: NONE
    Reconstruct Branch: AU_LINUX_ANDROID_LNX.LA.3.5.1_RB1.04.04.02.048.006 +  NOTHING
12-27 21:36:49.997    6220-6220/com.angelo.assassinscreedquiz D/OpenGLRenderer﹕ Enabling debug mode 0
12-27 21:36:50.027    6220-6220/com.angelo.assassinscreedquiz D/tcd﹕ process windowFocusChanged msg
12-27 21:36:50.237    6220-6220/com.angelo.assassinscreedquiz I/ActivityManager﹕ Timeline: Activity_idle id: android.os.BinderProxy@41ad4b00 time:40737600
12-27 21:36:51.207    6220-6220/com.angelo.assassinscreedquiz I/ActivityManager﹕ Timeline: Activity_launch_request id:com.angelo.assassinscreedquiz time:40738579
12-27 21:36:51.217    6220-6232/com.angelo.assassinscreedquiz D/tcd﹕ Focus to false
12-27 21:36:51.227    6220-6220/com.angelo.assassinscreedquiz D/tcd﹕ process windowFocusChanged msg
12-27 21:36:51.277    6220-6220/com.angelo.assassinscreedquiz D/RANDOM﹕ 6
12-27 21:36:51.277    6220-6220/com.angelo.assassinscreedquiz D/RANDOM﹕ 18
12-27 21:36:51.277    6220-6220/com.angelo.assassinscreedquiz D/RANDOM﹕ 19
12-27 21:36:51.277    6220-6220/com.angelo.assassinscreedquiz D/RANDOM﹕ 8
12-27 21:36:51.277    6220-6220/com.angelo.assassinscreedquiz D/RANDOM﹕ 14
12-27 21:36:51.277    6220-6220/com.angelo.assassinscreedquiz D/RANDOM﹕ 0
12-27 21:36:51.277    6220-6220/com.angelo.assassinscreedquiz D/RANDOM﹕ 16
12-27 21:36:51.277    6220-6220/com.angelo.assassinscreedquiz D/RANDOM﹕ 3
12-27 21:36:51.277    6220-6220/com.angelo.assassinscreedquiz D/RANDOM﹕ 1
12-27 21:36:51.277    6220-6220/com.angelo.assassinscreedquiz D/RANDOM﹕ 4
12-27 21:36:51.357    6220-6220/com.angelo.assassinscreedquiz D/dalvikvm﹕ GC_FOR_ALLOC freed 171K, 6% free 4522K/4764K, paused 16ms, total 16ms
12-27 21:36:51.357    6220-6220/com.angelo.assassinscreedquiz I/dalvikvm-heap﹕ Grow heap (frag case) to 5.587MB for 635812-byte allocation
12-27 21:36:51.457    6220-6230/com.angelo.assassinscreedquiz D/tcd﹕ Focus to true
12-27 21:36:51.457    6220-6244/com.angelo.assassinscreedquiz D/QUESTION﹕ 6
12-27 21:36:51.457    6220-6244/com.angelo.assassinscreedquiz D/data_question﹕ Question3
12-27 21:36:51.577    6220-6220/com.angelo.assassinscreedquiz D/tcd﹕ process windowFocusChanged msg
12-27 21:36:51.577    6220-6220/com.angelo.assassinscreedquiz D/tcd﹕ imm = android.view.inputmethod.InputMethodManager@41b11a60 falseflg=#1820002
12-27 21:36:51.597    6220-6230/com.angelo.assassinscreedquiz D/tcd﹕ Focus to true
12-27 21:36:51.757    6220-6220/com.angelo.assassinscreedquiz D/tcd﹕ process windowFocusChanged msg
12-27 21:36:51.777    6220-6231/com.angelo.assassinscreedquiz D/tcd﹕ Focus to false
12-27 21:36:51.867    6220-6220/com.angelo.assassinscreedquiz I/ActivityManager﹕ Timeline: Activity_idle id: android.os.BinderProxy@41b25560 time:40739238
12-27 21:36:54.117    6220-6220/com.angelo.assassinscreedquiz D/dalvikvm﹕ GC_FOR_ALLOC freed 178K, 5% free 5477K/5724K, paused 11ms, total 11ms
12-27 21:36:54.117    6220-6220/com.angelo.assassinscreedquiz I/ActivityManager﹕ Timeline: Activity_launch_request id:com.facebook.katana time:40741484
12-27 21:36:54.127    6220-6232/com.angelo.assassinscreedquiz D/tcd﹕ Focus to false
12-27 21:36:54.127    6220-6220/com.angelo.assassinscreedquiz D/QUESTIONSACTIVITY﹕ It was paused
12-27 21:36:54.137    6220-6220/com.angelo.assassinscreedquiz D/tcd﹕ process windowFocusChanged msg
12-27 21:36:56.387    6220-6232/com.angelo.assassinscreedquiz D/tcd﹕ Focus to true
12-27 21:36:56.387    6220-6220/com.angelo.assassinscreedquiz D/tcd﹕ process windowFocusChanged msg
12-27 21:36:56.617    6220-6220/com.angelo.assassinscreedquiz I/ActivityManager﹕ Timeline: Activity_idle id: android.os.BinderProxy@41b25560 time:40743989
12-27 21:37:09.457    6220-6220/com.angelo.assassinscreedquiz D/QUESTIONSACTIVITY﹕ It was paused
12-27 21:37:09.597    6220-6220/com.angelo.assassinscreedquiz W/IInputConnectionWrapper﹕ getExtractedText on inactive InputConnection
12-27 21:37:09.597    6220-6220/com.angelo.assassinscreedquiz W/IInputConnectionWrapper﹕ getTextBeforeCursor on inactive InputConnection
12-27 21:37:09.597    6220-6220/com.angelo.assassinscreedquiz W/IInputConnectionWrapper﹕ getSelectedText on inactive InputConnection
12-27 21:37:09.597    6220-6220/com.angelo.assassinscreedquiz W/IInputConnectionWrapper﹕ getTextAfterCursor on inactive InputConnection
12-27 21:37:14.977    6220-6232/com.angelo.assassinscreedquiz D/tcd﹕ Focus to false
12-27 21:37:14.977    6220-6220/com.angelo.assassinscreedquiz D/tcd﹕ process windowFocusChanged msg


Anyone has an idea about what might be happening? Thank you before hand!






Aucun commentaire:

Enregistrer un commentaire