2016-08-03 9 views
2

どのように不透明なFacebookのエラーを処理するには?これをデバッグするための手順は何ですか?Xamarin.Auth Facebookのログインが動作しません、曖昧なエラーメッセージ

私はXamarin.Authを使用してMyAppをするのFacebookのOAuth2認証を添付しようとしているが、私は次のエラーを得続ける:

enter image description hereが、私はFacebookのダッシュボードにAndroidプラットフォームを追加し、Googleのパッケージ名、クラス名前、キーハッシュ(Facebookのクイックスタートガイドなどのすべての手順に従ってください)でも同じエラーです。私は必死で、何が間違っているのですか?

私のmanifest.xml:

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto" package="com.example"> 
    <uses-sdk android:minSdkVersion="15" /> 
    <application android:label="@string/app_label"> 
     <activity android:name="com.example.Myapp" android:label="@string/app_label" /> 
     <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id" /> 
    </application> 
    <uses-permission android:name="android.permission.INTERNET" /> 
</manifest> 

のstrings.xml:

<?xml version="1.0" encoding="utf-8" ?> 
<resources> 
    <string name="facebook_app_id">...</string> 
    <string name="app_label">Myapp</string> 
</resources> 

キーハッシュ(もに、PackageInfoなどとアプリの中からそれを生成しようとしました - >同じキー):

keytool -exportcert -alias androiddebugkey -keystore "%LocalAppData%\Xamarin\Mono for Android\debug.keystore" | C:\OpenSSL-Win32\bin\openssl sha1 -binary | C:\OpenSSL-Win32\bin\openssl base64 

Facebook設定: google playパッケージ名:com.example クラス名:com.example.Myapp(試さcom.example.MainActivityこことのmanifest.xmlで - あまりにもなし成功)

MainActivity.csスニペット:

namespace Myapp.Droid 
{ 
    [Activity(Label = "Myapp", Icon = "@drawable/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] 
    public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity 

マイLoginPageRenderer.cs

スニペット:

var auth = new OAuth2Authenticator(
       clientId: "...", // it is valid! I checked 
       clientSecret: "...", 
       accessTokenUrl: new Uri("https://graph.facebook.com/oauth/access_token"), 
       scope: "email", // the scopes for the particular API you're accessing, delimited by "+" symbols 
       authorizeUrl: new Uri("https://m.facebook.com/dialog/oauth/"), // the auth URL for the service 
       redirectUrl: new Uri("http://www.facebook.com/connect/login_success.html")); // the redirect URL for the service 

答えて

0

問題が正しくありませんでした。有効なOAuthリダイレクトURI(Facebookログインページで設定、Facebookダッシュボードのサイドメニューにリンク)

また、そのページには前述の誤解を招くエラーメッセージを表示する他の設定もあります。