Limiting permissions using the Facebook Android SDK - android

I'm currently integrating an android app with the new Android Facebook 3 SDK.
I've got it working, but I've noticed that in "My Apps" on facebook it states that the app needs to post on my behalf to my friends. This is not a requirement for this app and I have not specifically requested any extra permissions. I have noticed that a number of other apps in my app centre can only post to "only me".
How do I remove the need for this permission?

You can use the setReadPermissions() of the LoginButton class for this.
this will only set the read permissions.
to set publish permissions you need to use setPublishPermissions().
the login button can only be associated with one of these at a time.

If you see that your app has publish permissions in your facebook settings, that means at some point you have authorized the app for publish permissions.
If you want to remove it from your settings, you can either remove the app, or remove just the "Post on your behalf" permission (in your facebook settings).
Then, you can change your app to only request read permissions, and not publish permissions. You cannot remove permissions from the app directly, you can only request more.

Related

Facebook API - Can't apply for the 'user_photos' permission

I have an Android app that uses the 'publish_actions' and 'user_photos' permissions to create photo albums on Facebook. I have already applied and been approved for 'publish_actions'. However, it will not let me apply for the 'user_photos' permission, because it says my app has not used this permission in the last thirty days.
My app does in fact use this permission. I have successfully published albums repeatedly from developer accounts and test user accounts. This only works if I use the 'user_photos' permission. If I try to create an album when I haven't requested 'user_photos', it doesn't work
Yet it still says I'm not using this permission. And I didn't have this problem with the 'publish_actions' permission; it was able to recognize that I was using it.
What do I need to do to make this permission available for applying? It almost seems like creating an album "requires" the permission, but does not "use" it.
I've heard some suggest that you need to be using the app owner's account, but again, this was not necessary for 'publish_actions'.
I solved this problem by changing the functionality of my app. Now my app reads in a user's albums, and appends photos to the album if it already exists. Doing so results in Facebook recognizing the use of the permission, which allows me to apply for it.
Overall, this still seems like a bug on Facebook's end.
You don't need the user_photos permission to publish photos, only publish_actions. You do need user_photos to be able to read (and get) the photos that a user has uploaded.
You, as an admin on the app, is allowed to grant any permissions you want to your app (since you'd need to be able to do that for development). Users who are not in an admin/dev/test role in your app will not be able to use any features that require additional permissions until your app is approved.

Does Google Play ask to accept custom permission as like in built permissions in case of auto update

I am working on an app where I am using a custom permission as defined by another developer in their SDK.
According to Google, if we add a pre-defined permission, such as <uses-permission android:name="android.permission.INTERNET" />, then, when a user updates the app, they will be prompted to approve this new permission. This happens before the app is updated; if the user does not accept, the app is not updated.
Now, we want to add in this custom permission. Will the Play Store still ask users to accept this new permission prior to updating the app when we release the new version on the Play store?
Yes all permissions are required to be approved by the user. If the updated version has new permissions : grouped or others, they need to be approved by user.
From Google's policies:
Users who wish to have full control over new individual permissions being added to an app can review individual permissions for an app at any time, or may consider turning off auto-updates for one or more apps. Any permissions that are not part of a permissions group, including those that are not shown in the main permissions screen, will be shown in the "Other" group.
Update
From M the permission model will change. Users will control the permissions at runtime. Good for users but more work for developers, as now we have to handle the permission denial. Read more here.
When people download your app they have to accept the permissions that you set in your manifest.
If you set a new permission in the android manifest of your app, then people who have downloaded your app will need to accept the new permission first. So if you update your app and you have new permission it won't auto update and people need to first accept it in the google play store.
From Google's support page:
When an app updates, it may need to use additional
capabilities or information controlled by permissions.
If you have automatic updates enabled, you won't need to review or
accept these permissions as long as they are included in a permissions
group you already accepted for that app.
If the app needs access to an additional permissions group, you'll be
asked to accept the update, even if you've set an app to update
automatically.
If you prefer to review each update manually, you can change your
update settings.
Yes, Google play will ask users to approve custom permissions.
Google clearly mentions that
"If the app needs access to an additional permissions group, you'll be asked to accept the update, even if you've set an app to update automatically."
and
"Developers may automatically add additional permissions within each group"
Since custom permissions do not belong do any permission group, they are shown in other permissions and when updating an app if new permissions are added to others group, play store will ask users to approve those permissions.
Official Source: https://support.google.com/googleplay/answer/6014972 (open link and click on other)
This page says "Note: If an app adds a permission that is in the "Other" group, you'll always be asked to review the change before downloading an update."

Why I can't get the permission "publish_actions" from Facebook on Android APP

I am creating an application that needs posting on the timeline of User, and to make the test development I always used an App ID I had already created for some time and it works normal. However, I had to create a final version of the application so that does not work and created the same way I created the test App ID. Afterwards, I came across what appears to be a new privacy policy of Facebook "Submit Items for Approval" is my doubt.
Is really necessary from now when creating a new application has to submit revision of Facebook to be able to have permission "publish_actions"?
If you want your app to be accessible to the public, aka publish on a random user's timeline, you now need to request for publish_actions permission. You can read all about permissions here: https://developers.facebook.com/docs/facebook-login/permissions/v2.0

android facebook sdk 3 disable sso permissions issue

I am integrating facebook in android I needed to disable SSO cause some old built in fb apps cause a problem..
I used this solution : https://stackoverflow.com/a/17673471/1862806
It is working good and i changed it to open for publish to request permissions too:
session.openForPublish(new Session.OpenRequest(this).setCallback(fbCallback).setLoginBehavior(SessionLoginBehavior.SUPPRESS_SSO).setPermissions(PERMISSIONS));
If the user accepts the permissions while running the application, all is good, if he chooses to skip the publish permissions, i can't know in code, cause when i check using
List<String> permissions = session.getPermissions();
System.out.println(permissions);
I get permissions = [public_actions] as if user accepted them !!
I need to check if user skipped publish permissions in code while disabling SSO (it works with soo).. any idea how ?
thanks
Looks like a potential bug, but you can always make a request to me/permissions using the Request class, and it will give you a list of permissions that the user has granted your app.
It's good to check this endpoint in general (probably once per startup) since the user can remove permissions via the Facebook website at any time.

FB Android: How to ask a publish permission during installation?

I'm trying to convert my app to use the new Facebook Android SDK 3.0. I want to be able to check in places with my app. I've switched my old log in method to the native-login button supplied with the SDK. As far as I understand I can't ask for publishing permission during the installation process without asking for a basic permission first. And I can't set both publish and read permissions to the login button, because this will cause an exception. Then how should I do this? I don't want my user to deal with two dialog screens (every click matters). I want to ask for the permission once during the installation (first time use) process, and not when the publishing will occur (this damages the designed flow of my app).
Thank you in advance,
Dan
No you cannot ask for Publish Permission during app install (Only basic permission)
Publish permission dialog will be asked only once
Your right asking publish permission at install time will throw exception & break the login flow

Categories

Resources