Home Facebook login with FirebaseUI for Android - how to get publish_actions permission?
Reply: 0

Facebook login with FirebaseUI for Android - how to get publish_actions permission?

user1815
1#
user1815 Published in June 24, 2018, 11:58 pm

I want to make a facebook leaderboard, so I need to use the graph API for score. I have no problem to read the player's score. What is the best way to update the score of the player when his score changes ? At the moment, everytime the score changes I : - read the current score with the graph API - increase the score (for example +1 point if the player wins) - update the score with the graph API

My issue is that I don't know how to get the publish_actions permission when the user logs in. I need it to update the score with the facebook graph API.

Here is my code :

                AuthUI.IdpConfig facebookIdp = new AuthUI.IdpConfig.Builder(AuthUI.FACEBOOK_PROVIDER)
                        .setPermissions(Arrays.asList("user_friends", "publish_actions"))
                        .build();

                startActivityForResult(
                        AuthUI.getInstance()
                                .createSignInIntentBuilder()
                                .setIsSmartLockEnabled(false)
                                .setProviders(Arrays.asList(new AuthUI.IdpConfig.Builder(AuthUI.EMAIL_PROVIDER).build(),
                                        facebookIdp))
                                .setTheme(R.style.loginTheme)
                                .build(),
                        RC_SIGN_IN);

The problem is that .setPermissions(Arrays.asList("user_friends", "publish_actions")) do not gives me the publish_permission. It says "Cannot pass a publish or manage permission (publish_actions) to a request for read authorization".

So I understand that .setPermission works for read permissions only. How can I get the publish_actions permission for my Android app using FirebaseUI ?

Thank you,

Alex

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.315071 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO