-1

ソーシャル ネットワーキングを統合する Android アプリを開発しようとしています。最初に試したのは Facebook です。認証機能を実行するとき、ネイティブアプリを呼び出す代わりに WebView を使用しています (ただし、ネイティブアプリも使用して同じ結果を得るようにしました)。認証機能を実行すると、「読み込み中」ダイアログが表示されますが、しばらくすると停止してアクティビティに戻ります。

エミュレーターで作業すると、ログイン/許可/拒否画面が表示されます。実際のデバイスで使用しようとすると、https URL が読み込まれません (例: https://graph.facebook.com/ 19292868552 https://m.facebook.com/dialog/など)。

奇妙なことに、アプリが Android デバイスの任意のブラウザーで使用しようとするのと同じ facebook https リンクを配置しようとすると、そこにも読み込まれず、「Web ページを利用できません」というメッセージが表示されます。他のすべての https リンクは、gmail、paypal、greendotcard などで正常に機能します。PC のブラウザで同じ https リンクを試してみると、ページは正常に読み込まれます。

デバイス:

  1. アンドロイド 2.2.2 (LG-P505)
  2. WIFIを使用して接続しました(はい、接続は機能しています)

別のデバイス(まったく同じモデルとAndroidバージョン)でこれを試しましたが、同じ結果が得られました。ただし、Android 4.0.3 (clockworkmod/rom manager など) を使用するようにデバイスを切り替えると、アプリは正常に動作します (facebook https リンクは正常に動作します)。

他の人が同様の問題を抱えているのを見たので、次のことを試しました。

  1. 電話の再起動
  2. インターネット接続を確認しました
  3. WebViewClient で onReceiveSslError を設定します。
public void onReceivedSslError (WebView view, SslErrorHandler handler, SslError error) 
{
  Log.d("Facebook connection","SSL ERROR");
  handler.proceed() ;
}

facebook 認証関数を実行するコード:

    facebook.authorize(this, new String[] { "read_stream", "publish_stream" }, new DialogListener() {
        public void onComplete(Bundle values) 
        {
            Log.d("Facebook onComplete",""+values);
        }

        public void onFacebookError(FacebookError error) {
            Log.d("Facebook onFacebookError",error.getMessage());
        }

        public void onError(DialogError e) 
        {
            Log.d("Facebook onError",e.getMessage());
        }

        public void onCancel() 
        {
            Log.d("Facebook onCancel","It canceled?");
        }
    });       

LogCat:

06-06 10:43:48.991: V/webkit(22468): BrowserFrame constructor: this=Handler{44be3ba0}
06-06 10:43:49.001: V/webcore(22468): LOAD_URL arg1=0 arg2=0 obj=android.webkit.WebViewCore$GetUrlData@44be55c8
06-06 10:43:49.011: V/webcore(22468):  CORE loadUrl https://m.facebook.com/dialog/oauth?display=touch&client_id=CLIENTID&scope=read_stream%2Cpublish_stream&type=user_agent&redirect_uri=fbconnect%3A%2F%2Fsuccess
06-06 10:43:49.011: V/webkit(22468): startLoadingResource: url=https://m.facebook.com/dialog/oauth?display=touch&client_id=CLIENTID&scope=read_stream%2Cpublish_stream&type=user_agent&redirect_uri=fbconnect%3A%2F%2Fsuccess, method=GET, postData=null, isMainFramePage=true, mainResource=true, userGesture=true
06-06 10:43:49.021: V/webkit(22468): LoadListener constructor url=https://m.facebook.com/dialog/oauth?display=touch&client_id=CLIENTID&scope=read_stream%2Cpublish_stream&type=user_agent&redirect_uri=fbconnect%3A%2F%2Fsuccess
06-06 10:43:49.021: D/KeyguardViewMediator(1384): setHidden false
06-06 10:43:49.031: V/http(22468): 44550853 http0 RequestQueue.getRequest() => null
06-06 10:43:49.031: V/http(22468): 44550854 http0 ConnectionThread: Waiting for work
06-06 10:43:49.031: V/webview(22468): sendOurVisibleRect=(14,39,r=306,b=466
06-06 10:43:49.031: V/http(22468): 44550856 http1 RequestQueue.getRequest() => null
06-06 10:43:49.031: V/http(22468): 44550856 http1 ConnectionThread: Waiting for work
06-06 10:43:49.041: V/http(22468): 44550866 http2 RequestQueue.getRequest() => null
06-06 10:43:49.041: V/http(22468): 44550866 http2 ConnectionThread: Waiting for work
06-06 10:43:49.041: V/http(22468): 44550867 http3 RequestQueue.getRequest() => null
06-06 10:43:49.041: V/http(22468): 44550867 http3 ConnectionThread: Waiting for work
06-06 10:43:49.051: D/KeyguardViewMediator(1384): setHidden false
06-06 10:43:49.051: V/webview(22468): WEBCORE_INITIALIZED_MSG_ID
06-06 10:43:49.051: V/webcore(22468): SET_SCROLL_OFFSET arg1=0 arg2=0 obj=Point(0, 0)
06-06 10:43:49.051: V/webcore(22468): SET_GLOBAL_BOUNDS arg1=0 arg2=0 obj=Rect(14, 39 - 306, 466)
06-06 10:43:49.051: V/webcore(22468): VIEW_SIZE_CHANGED arg1=0 arg2=0 obj=android.webkit.WebView$ViewSizeData@44bf1b88
06-06 10:43:49.051: V/webcore(22468): viewSizeChanged w=292; h=427; textwrapWidth=292; scale=1.0
06-06 10:43:49.051: V/webcore(22468): viewSizeChanged
06-06 10:43:49.051: V/webcore(22468): UPDATE_CACHE_AND_TEXT_ENTRY arg1=0 arg2=0 obj=null
06-06 10:43:49.061: V/webview(22468): setCertificate=null
06-06 10:43:49.081: W/Flex(22468): getString FLEX_OPERATOR_CODE ATT
06-06 10:43:49.081: W/Flex(22468): getString FLEX_MCC_CODE 310
06-06 10:43:49.081: W/Flex(22468): getString FLEX_OPERATOR_CODE ATT
06-06 10:43:49.081: W/Flex(22468): getString FLEX_MNC_CODE 410
06-06 10:43:49.081: W/Flex(22468): getString FLEX_OPERATOR_CODE ATT
06-06 10:43:49.091: W/Flex(22468): getString FLEX_OPERATOR_CODE ATT
06-06 10:43:49.091: W/Flex(22468): getString FLEX_OPERATOR_CODE ATT
06-06 10:43:49.131: V/webkit(22468): [web] x-wap-profile info is read from flex.
06-06 10:43:49.131: V/webkit(22468): [web] x-wap-profile added = http://gsm.lge.com/html/gsm/P505-M6-D1.xml
06-06 10:43:49.131: W/Flex(22468): getString FLEX_OPERATOR_CODE ATT
06-06 10:43:49.131: V/webkit(22468): [web] x-att-deviceid : LG-P505/V10i
06-06 10:43:49.141: V/webkit(22468): getCookie: uri: https://m.facebook.com/dialog/oauth?display=touch&client_id=CLIENTID&scope=read_stream%2Cpublish_stream&type=user_agent&redirect_uri=fbconnect%3A%2F%2Fsuccess value: datr=yLHOT47krLHRlqDkKtLSPq5-; m_ts=1338946325; reg_fb_gate=http%3A%2F%2Fm.facebook.com%2Flogin.php%3Fapp_id%3DCLIENTID%26cancel%3Dfbconnect%253A%252F%252Fsuccess%253Ferror_reason%253Duser_denied%2526error%253Daccess_denied%2526error_description%253DThe%252Buser%252Bdenied%252Byour%252Brequest.%26fbconnect%3D1%26next%3Dhttp%253A%252F%252Fm.facebook.com%252Fdialog%252Fpermissions.request%253F_path%253Dpermissions.request%2526app_id%253DCLIENTID%2526redirect_uri%253Dfbconnect%25253A%25252F%25252Fsuccess%2526display%253Dtouch%2526type%253Duser_agent%2526perms%253Dread_stream%25252Cpublish_stream%2526fbconnect%253D1%2526from_login%253D1%2526client_id%253DCLIENTID%26rcount%3D1; reg_fb_ref=http%3A%2F%2Fm.facebook.com%2Flogin.php%3Fapp_id%3DCLIENTID%26cancel%3Dfbconnect%253A%252F%252Fsuccess%253Ferror_reason%253Duser_denied%2526error%253Daccess_denied%2526error_description%253DThe%252Buser%252Bdenied%252Byour%252Brequest.%26fbconnect%3D1%26next%3Dhttp%253A%252F%252Fm.facebook.com%252Fdialog%252Fpermissions.request%253F_path%253Dpermissions.request%2526app_id%253DCLIENTID%2526redirect_uri%253Dfbconnect%25253A%25252F%25252Fsuccess%2526display%253Dtouch%2526type%253Duser_agent%2526perms%253Dread_stream%25252Cpublish_stream%2526fbconnect%253D1%2526from_login%253D1%2526client_id%253DCLIENTID%26rcount%3D1
06-06 10:43:49.141: V/webkit(22468): FrameLoader: http GET load for: https://m.facebook.com/dialog/oauth?display=touch&client_id=CLIENTID&scope=read_stream%2Cpublish_stream&type=user_agent&redirect_uri=fbconnect%3A%2F%2Fsuccess
06-06 10:43:49.151: V/http(22468): 44550972 WebViewWorkerThread RequestQueue.queueRequest https://m.facebook.com/dialog/oauth?display=touch&client_id=CLIENTID&scope=read_stream%2Cpublish_stream&type=user_agent&redirect_uri=fbconnect%3A%2F%2Fsuccess
06-06 10:43:49.151: V/http(22468): 44550974 http0 RequestQueue.getRequest() => /dialog/oauth?display=touch&client_id=CLIENTID&scope=read_stream%2Cpublish_stream&type=user_agent&redirect_uri=fbconnect%3A%2F%2Fsuccess
06-06 10:43:49.151: V/http(22468): 44550974 http0 ConnectionThread: new request https://m.facebook.com:443 /dialog/oauth?display=touch&client_id=CLIENTID&scope=read_stream%2Cpublish_stream&type=user_agent&redirect_uri=fbconnect%3A%2F%2Fsuccess
06-06 10:43:49.151: V/http(22468): 44550975 http0 SEND pipe 0
06-06 10:43:49.161: V/webkit(22468): LoadListener.attachRequestHandle(): requestHandle: android.net.http.RequestHandle@44c0eef8
06-06 10:43:49.201: V/webview(22468): SET_SCROLLBAR_MODES
06-06 10:43:49.201: V/webview(22468): SET_SCROLLBAR_MODES
06-06 10:43:49.201: V/webview(22468): SET_SCROLLBAR_MODES
06-06 10:43:49.201: V/webview(22468): UPDATE_TEXT_ENTRY_MSG_ID
06-06 10:43:49.261: V/webcore(22468): SET_ACTIVE arg1=0 arg2=0 obj=null
06-06 10:43:50.391: D/DfeApi(17382): [1] DfeRequest.deliverResponse: Not delivering second response for request=[[ ] https://android.clients.google.com/fdfe/details?doc=sui.m NORMAL 415]
06-06 10:43:50.391: D/Volley(17382): [1] Request.finish: 5076 ms: [ ] https://android.clients.google.com/fdfe/details?doc=sui.m NORMAL 415
06-06 10:44:00.061: I/hs(21761): android.intent.action.TIME_TICK
06-06 10:44:02.841: D/Finsky(17382): [1] 5.onFinished: Installation state replication succeeded.
06-06 10:44:10.491: V/http(22468): 44572311 http0 Connection.openHttpConnection() 21336 https://m.facebook.com:443
06-06 10:44:10.491: V/http(22468): 44572312 http0 RequestQueue.getRequest() => /dialog/oauth?display=touch&client_id=CLIENTID&scope=read_stream%2Cpublish_stream&type=user_agent&redirect_uri=fbconnect%3A%2F%2Fsuccess
06-06 10:44:10.491: V/http(22468): 44572313 http0 ConnectionThread: new request https://m.facebook.com:443 /dialog/oauth?display=touch&client_id=CLIENTID&scope=read_stream%2Cpublish_stream&type=user_agent&redirect_uri=fbconnect%3A%2F%2Fsuccess
06-06 10:44:10.491: V/http(22468): 44572314 http0 SEND pipe 0
06-06 10:44:31.501: V/http(22468): 44593321 http0 Connection.openHttpConnection() 21006 https://m.facebook.com:443
06-06 10:44:31.501: V/http(22468): 44593321 http0 RequestQueue.getRequest() => /dialog/oauth?display=touch&client_id=CLIENTID&scope=read_stream%2Cpublish_stream&type=user_agent&redirect_uri=fbconnect%3A%2F%2Fsuccess
06-06 10:44:31.501: V/http(22468): 44593322 http0 ConnectionThread: new request https://m.facebook.com:443 /dialog/oauth?display=touch&client_id=CLIENTID&scope=read_stream%2Cpublish_stream&type=user_agent&redirect_uri=fbconnect%3A%2F%2Fsuccess
06-06 10:44:31.501: V/http(22468): 44593323 http0 SEND pipe 0
06-06 10:44:52.511: V/http(22468): 44614331 http0 Connection.openHttpConnection() 21006 https://m.facebook.com:443
06-06 10:44:52.511: V/http(22468): 44614332 http0 httpFailure() ******* java.io.IOException: The operation timed out count 2 https://m.facebook.com:443 /dialog/oauth?display=touch&client_id=CLIENTID&scope=read_stream%2Cpublish_stream&type=user_agent&redirect_uri=fbconnect%3A%2F%2Fsuccess
06-06 10:44:52.511: V/webkit(22468): LoadListener.error url:https://m.facebook.com/dialog/oauth?display=touch&client_id=CLIENTID&scope=read_stream%2Cpublish_stream&type=user_agent&redirect_uri=fbconnect%3A%2F%2Fsuccess id:-6 description:The connection to the server was unsuccessful.
06-06 10:44:52.511: V/webkit(22468): LoadListener.detachRequestHandle(): requestHandle: android.net.http.RequestHandle@44c0eef8
06-06 10:44:52.521: V/http(22468): 44614343 http0 RequestQueue.getRequest() => null
06-06 10:44:52.521: D/Facebook onError(22468): The connection to the server was unsuccessful.
06-06 10:44:52.521: V/http(22468): 44614345 http0 ConnectionThread: Waiting for work
06-06 10:44:52.521: V/webview(22468): setCertificate=null
06-06 10:44:52.551: I/ActivityManager(1384): Displayed activity com.fadedfootsteps/.FadedFootstepsActivity: 64220 ms (total 64220 ms)
06-06 10:44:52.591: V/webkit(22468): startLoadingResource: url=file:///android_asset/webkit/android-weberror.png, method=GET, postData=null, isMainFramePage=true, mainResource=false, userGesture=true
06-06 10:44:52.591: V/webkit(22468): LoadListener constructor url=file:///android_asset/webkit/android-weberror.png
06-06 10:44:52.601: V/webkit(22468): LoadListener: from: file:///android_asset/webkit/android-weberror.png major: 1 minor: 1 code: 200 reason: OK
06-06 10:44:52.601: V/webkit(22468): LoadListener.headers
06-06 10:44:52.601: V/webkit(22468): LoadListener.data(): url: file:///android_asset/webkit/android-weberror.png
06-06 10:44:52.601: V/webkit(22468): LoadListener.endData(): url: file:///android_asset/webkit/android-weberror.png
06-06 10:44:52.601: V/webkit(22468): guessMimeTypeFromExtension: url = file:///android_asset/webkit/android-weberror.png
06-06 10:44:52.631: V/webkit(22468): LoadListener.detachRequestHandle(): requestHandle: null
06-06 10:44:52.631: V/webview(22468): SET_SCROLLBAR_MODES
06-06 10:44:52.631: V/webview(22468): SET_SCROLLBAR_MODES
06-06 10:44:52.631: V/webview(22468): SET_SCROLLBAR_MODES
06-06 10:44:52.641: V/webcore(22468): didFirstLayout standardLoad =true
06-06 10:44:52.641: V/webcore(22468): WEBKIT_DRAW arg1=0 arg2=0 obj=null
06-06 10:44:52.651: V/webcore(22468): webkitDraw start
06-06 10:44:52.651: V/webview(22468): UPDATE_TEXT_ENTRY_MSG_ID
06-06 10:44:52.681: V/webcore(22468): webkitDraw NEW_PICTURE_MSG_ID
06-06 10:44:52.691: V/webview(22468): NEW_PICTURE_MSG_ID
06-06 10:44:52.701: V/webview(22468): NEW_PICTURE_MSG_ID {0,0,1063,427}
4

1 に答える 1