错误的社会身份验证4.4 ::无效的范围:publish_stream。 [英] Error Social Auth 4.4:: Invalid Scopes: publish_stream.

查看:573
本文介绍了错误的社会身份验证4.4 ::无效的范围:publish_stream。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我,当我尝试用<一个连接得到这个错误href="http://www.3pillarglobal.com/insights/part-1-using-socialauth-to-integrate-facebook-api-in-android">SOCIAL AUTH 的4.4整合Facebook的API在Android中。

I got this error when i try to connect with SOCIAL AUTH 4.4 TO INTEGRATE FACEBOOK API IN ANDROID.

几天就回来一切正常,我能够把数据上传至Facebook从我的应用程序。

Few days back everything is working fine and i am able to post the data to Facebook from my application.

现在我收到此错误,而试图从我的应用程序访问Facebook的。

Now i am getting this error while trying to access the Facebook from my application.

无效的范围:offline_access,publish_stream。此消息仅   显示开发商。您的应用程序的用户会忽略这些权限   如果present。请仔细阅读在合法权限的文档:   <一href="https://developers.facebook.com/docs/facebook-login/permissions">https://developers.facebook.com/docs/facebook-login/permissions

Invalid Scopes: offline_access, publish_stream. This message is only shown to developers. Users of your app will ignore these permissions if present. Please read the documentation for valid permissions at: https://developers.facebook.com/docs/facebook-login/permissions

看完单证后,我才知道,权限offline_access和publish_stream是德precated,因此不能再申请。

After reading the documentations i came to know that , The permissions offline_access and publish_stream are deprecated, thus cannot be requested anymore.

所以我替换根据我的文档属性文件。

So i replaced my properties file according to the documentation.

publish_stream可以通过publish_actions更换,offline_access走了。

publish_stream can be replaced by publish_actions, offline_access is gone.

像下面:::

#facebook
graph.facebook.com.consumer_key = XXXXXXXXXXXXX
graph.facebook.com.consumer_secret = XXXXXXXXXXXXXXXXXXXXXXXXXXX
graph.facebook.com.custom_permission = publish_actions,email,user_birthday,user_location

不过我得到了同样的问题。确切位置在哪里我的思念。

Still i am getting the same issue. Where exactly i am missing..

推荐答案

如Facebook改变了太多的内部设置,近期最好是使用Facebook SDK,而不是社会身份验证

As Facebook changed too many internal settings recently it is better to use Facebook SDK rather than Social Auth

有关如何开始使用Facebook的SDK工作,你需要创建Facebook的开发者控制台项目敬请参阅以下链接的进行

For getting started working with Facebook sdk you need to create a project in facebook developer console kindly refer below link to proceed.

一个应用程序创建的下载和导入最新的Facebook SDK 到您的项目

One App is created download and import latest facebook sdk in to your project

在进口设定的Facebook SDK为库项目到Eclipse

After import set facebook sdk as a library project to your eclipse

下面添加code在mainfestifile应用程序标签

add below code in your mainfestifile application tag

 <meta-data
            android:name="com.facebook.sdk.ApplicationId"
            android:value="@string/facebook_app_id" />

        <activity
            android:name="com.facebook.FacebookActivity"
            android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />

在这里被创造的同时在开发者控制台项目应用程序ID生成facebook_app_id

where facebook_app_id is app id generated while creating a project in developer console

不要忘了,包括网络的权限

dont forget to include internet permissions

然后添加以下code在活动

then add the following code in your Activity

//变量需要声明

 CallbackManager callbackManager;
    ShareDialog shareDialog;

//在活动的OnCreate

//in activity oncreate

FacebookSdk.sdkInitialize(getApplicationContext());
     callbackManager = CallbackManager.Factory.create();
     shareDialog = new ShareDialog(this);

//例如共享添加以下代码段中的按钮的点击利斯特

//For example sharing add the below snippet in on click lister of the button

ShareLinkContent content = new ShareLinkContent.Builder()
                .setContentUrl(Uri.parse(copyTextToClipBoard()))
                .build();

                shareDialog.show(content);

这篇关于错误的社会身份验证4.4 ::无效的范围:publish_stream。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆