Facebook integration problems, iOS primarily (DEF-1788) (SOLVED)

I’m trying to integrate Facebook into our game and ran into several issues, primarily on iOS-devices.

The documentation
request_publish_permissions doesn’t show the required parameter of audience in the example.

Implementation, how is it supposed to work?
You have three methods to use to setup permissions, get a token etc.

  • facebook.login
  • facebook.request_publish_permissions
  • facebook.request_read_permissions

Problems related to iOS-device.
I’ve tried several combinations of these methods, and none of them seems to be the silver bullet, so my question is, how am I supposed to use the Facebook APIs/methods? can’t get it to work properly…

I’m in need of the publish permissions to be able to use the Score/Achievements API on Facebook.

1. Using the request_publish_permissions with permissions such as email, public_profile, friends.
This works when running as HTML5, but on iOS it crashes the app instantly with a crash message in the logs saying that read permissions cannot be requested at the same time as publish permissions.

2. Using request_read_permissions with the read permissions and later calling the requesting_publish_permissions.

  • This works on HTML5 but with a bad user experience -> jumping twice to the Facebook dialog.
  • On iOS the callback for request_publish_permissions is never called, even though the dialog is shown and dismissed.

3. Same scenarios but using the facebook.login before them.

  • Same result, but flipping two/three times to the FB-dialog. Still no callback on iOS-device for publish_permissions.

Whatever I do, I’m not able to get read permissions and publish permissions. Which means that I can either Show the high score list among friends OR post your own score… which doesn’t make sense.

Any guidance would be great! :smile:

Cheers,
Håkan

Thanks for reporting this, we also have a similar issue reported and will adress this with high priority.
Cheers,
Andreas

2 Likes

@britzl @Ingela_Garneij any update regarding this issue?

I noticed the Facebook fix for Android, but this problem still remains.

Reproduced by following code, deployed to an iOS device.

facebook.request_publish_permissions({ “publish_actions”, “user_friends” }, facebook.AUDIENCE_FRIENDS, function (self, error)
if error then
end
end)

1 Like

Hey! Sorry, I haven’t had time to look into a solution for this, but I’ve added an issue just for this crash, DEF-1788.

2 Likes

Solved in Defold 1.2.90