I am developing an Android application that allows users to register via Facebook or Google+. With Google+ I can retrieve the user's email address but with Facebook I need additional permission to do this.
I have a LoginButton
in my layout and in the Activity code I have set it to request the email permission:
facebookLoginButton.setReadPermissions(Arrays.asList("email"));
This is fine as long as the user gives the permission. But if the user revokes that, my application doesn't work as expected. It needs the email address.
If the permission isn't granted, I call
Session.NewPermissionsRequest emailPermissionRequest = new Session.NewPermissionsRequest(this, Arrays.asList("email"));
session.requestNewReadPermissions(emailPermissionRequest);
This prompts the user to give the email permission. It can still be revoked and at the moment it just keeps asking it until it's granted.
How do I set the permission required? I'd like the user not to be able to login if the permission isn't granted. Spamming the permission dialog seems stupid.