Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error Social Auth 4.4:: Invalid Scopes: publish_stream.

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..

like image 433
King of Masses Avatar asked May 29 '15 06:05

King of Masses


2 Answers

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
...

like image 94
Tobi Avatar answered Nov 12 '22 19:11

Tobi


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);
like image 29
venkatesh venkey Avatar answered Nov 12 '22 20:11

venkatesh venkey