Android - Facebook connectivity fails

送分小仙女□ 提交于 2019-12-12 03:01:22

问题


In my Android app, I am integrating the Facebook SDK to have the shareDialog in it. The share dialog open perfectly with the pre-populated details. When I clicked SHARE on top right of sharedialog screen, I am getting the below mentioned error in logcat and in Toast. Please let me know where my config needs correction.

Logcat

04-17 15:15:47.140: E/Facebook(14515): Error: com.facebook.FacebookException: Failed to     
authenticate the application because of app name mismatch.  Please check the application   
name configured by the dialog.

回答1:


Go to Facebook developers page

Apps --> "YourApp" --> settings -->

Then change Package name (your application package name) and Class name (your activity class name)

for an example:




回答2:


This error is occuring due to mismatch of name, may be package name or class name or even application ID.

You need to check the AndroidMainfest.xml and also the dashboard of https://developers.facebook.com/apps/yourAppID/settings/. On the xml check if this is same as on the dashboard

<meta-data
        android:name="com.facebook.sdk.ApplicationId"
        android:value="app_id" />   //the app_id must be same as on the dashboard

    <activity android:name="com.facebook.LoginActivity" >
    </activity>

Also check for the package name, class name of the dashboard is same on your android app.



来源:https://stackoverflow.com/questions/23129969/android-facebook-connectivity-fails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!