问题
I got this error when i try to connect with SOCIAL AUTH 4.4 TO INTEGRATE FACEBOOK API IN ANDROID.
Few days back everything is working fine and i am able to post the data to Facebook from my application.
Now i am getting this error while trying to access the Facebook from my application.
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
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 can be replaced by publish_actions, offline_access is gone.
Like Below:::
#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..
回答1:
As Facebook changed too many internal settings recently it is better to use Facebook SDK rather than Social Auth
For getting started working with Facebook sdk you need to create a project in facebook developer console kindly refer below link to proceed.
One App is created download and import latest facebook sdk in to your project
After import set facebook sdk as a library project to your eclipse
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" />
where facebook_app_id is app id generated while creating a project in developer console
dont forget to include internet permissions
then add the following code in your Activity
//variables need to be declared
CallbackManager callbackManager;
ShareDialog shareDialog;
//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);
回答2:
Have a look at my answer here:
- Error Invalid Scopes: offline_access, publish_stream, when I try to connect with Facebook API
You should update to the most recent version 4.7 (https://code.google.com/p/socialauth/) and test again. I suspect that the permission set are set somewhere in the code as well.
Whats new in Version 4.7 ?
...
Facebook API v2.2 updated
...
回答3:
I've looked through the Socialauth sources and I see that you've made a slight error in your properties file. Custom permissions property should be named as
graph.facebook.com.custom_permissions
not the
graph.facebook.com.custom_permission
(note the s
on the end). I've tried it in my project and it works w/o any issues.
来源:https://stackoverflow.com/questions/30522836/error-social-auth-4-4-invalid-scopes-publish-stream