当尝试在我的 Android 应用程序上使用 Facebook SDK 时,我收到此错误:
“由于应用程序名称不匹配,无法对应用程序进行身份验证。请检查对话框中配置的应用程序名称。”
在阅读了有关此主题的许多帖子后,其他人也遇到了同样的问题并成功纠正了它,但我仍然无法让 Facebook SDK 工作......我认为 Facebook 上的应用程序配置和我的 Android 项目之间存在问题,但我不明白什么。
这是我在 Facebook 上的应用程序配置:
- 应用程序ID:752068304844308
- 显示名称:TestFSdk
- 命名空间:lbptestfsdk
Facebook 上 Android 的配置:
- 软件包名称:for.laposte.test sdk
- 类名:for.la poste.test sdk.MainActivity
- 密钥哈希:我通过密钥工具 + openssl (android 调试密钥)获得的哈希值
- 单点登录:是
- 深层链接:无
还有我的 Android 项目:
- Eclipse 项目名称:TestFSdk(重要吗?)
- 使用 FB SDK 的活动类:fr.laposte.testfsdk.MainActivity
-
strings.xml 包含:
<string name="app_id">752068304844308</string>
<string name="app_name">TestFSdk</string> --> is it usefull ?
-
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="fr.laposte.testfsdk"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/app_id"/>
<activity
android:name="fr.laposte.testfsdk.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.facebook.LoginActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:label="@string/app_name" />
</application>
</manifest>
你看到什么不对劲了吗?
感谢您的帮助。
请检查应用程序中的名称(在清单文件中)和 facebook() 上的应用程序名称。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)