0

Facebookでログインできるように、アプリにfacebook LoginButtonを追加しました。「デフォルト」の動作は次のとおりです (あまり変更はしていません)。

シナリオ (A) ユーザーが Facebook の公式アプリをインストールしている場合、アプリが呼び出され、自動的にログインし、許可を求めるダイアログが表示されます。シナリオ (B) または、ユーザーが facebook アプリを持っていない場合は、Web ページ (WebView など) がポップアップし、ユーザーにログインを求め、Web インターフェースを介して許可を求めます。

次のように動作します: Facebook ログインが facebook アプリケーションで機能しない

私のアプリは両方のシナリオの AVD エミュレーターで完全に動作しますが、「シナリオ (A)」は実際のデバイスでは動作しません。ログイン後、表示されます

ここに画像の説明を入力

誰も同じ問題に直面していますか?問題を解決する方法はありますか?または、アプリに強制的に Web インターフェイスを使用してログインを実行させる方法はありますか?

どうもありがとう!

Java および XML レイアウト コードは次のとおりです。

LoginButton authButton = (LoginButton) view.findViewById(R.id.fb_loginBtn);
    authButton.setFragment(this);
    authButton.setReadPermissions(Arrays.asList("basic_info", "email", "read_friendlists"));
    authButton.setOnErrorListener(fbErrorListener);
    authButton.setSessionStatusCallback(callback);

<com.facebook.widget.LoginButton
                xmlns:fb="http://schemas.android.com/apk/res-auto"
                android:id="@+id/fb_loginBtn"
                android:layout_width="200dp"
                android:layout_height="50dp"
                android:layout_gravity="center_vertical|center_horizontal"
                android:background="@drawable/reg_fb"
                fb:login_text="Facebook" />
4

2 に答える 2

0

Web のみを使用することはお勧めしませんが、本当に必要な場合:

LoginButton authButton = (LoginButton) view.findViewById(R.id.authButton);
//other code ...
authButton.setLoginBehavior(SessionLoginBehavior.SUPPRESS_SSO);
于 2013-08-07T07:28:39.153 に答える