Facebook SDK feed dialog wrong orientation.

I am using the official facebook sdk 6.0.0 for unity in order to post a highscore to the player’s feed in my app for iOS.
I am able to post successfully to the feed, however the dialog that appears is always portrait, with the top of the dialog on the home button side of my iPad.

I am posting with the FB.Feed() method and I can successfully add a link and picture to the dialog, it’s just always the wrong way round.

I have the app set to landscape left in the player settings.

Is the feed dialog meant to automatically orientate to that of the app, or do I have to explicitly set it somewhere?
I can’t find anything relating to this in the facebook sdk reference.

I have an older app that includes the facebook sdk 5.1.0 which worked as expected in landscape mode on iOS 7, but since updating to iOS 8 the older app now has the same issue with the dialog being in the wrong orientation.

I am using Unity Pro 4.5.4 and Facebook sdk 6.0.0. I am also using Vuforia 3.0.9 in my app if that affects it in any way.

Any help would be greatly appreciated.

I’ve found a workaround/fix for this, very dodgy, but seems to work with the limited testing I’ve done so far. Kudos go out to @ophilbert for pointing out where the fix is to be found.

Steps I took (I’m using a Linux box so your steps may vary):

Note: this relates to version 6.0 of the Facebook SDK for Unity.

This will give you a folder called FacebookSDK.pkg

  • Change into the FacebookSDK.pkg folder
  • Run cat Payload | gunzip -dc |cpio -icat Payload | gunzip -dc |cpio -i
  • cd to Documents/FacebookSDK/FacebookSDK.framework/Versions/A/

Here you’ll find a file FacebookSDK with no extension - copy this and name it FacebookSDK.a and copy it over the FacebookSDK.a in the Facebook/Editor/iOS/FacebookSDK/FacebookSDK.a file in your Unity project.

Fixed the issue for me.

You may be game and use an even newer version Facebook iOS SDK - it may work, it may not :slight_smile:

Remember, I’ve only done rudimentary tests on this, but it’s working for me, let me know if you find issues or have success!

Edit: If it helps here are the files I ripped out of that pkg (untouched):


I struggled a moment with this bug before realizing there was nothing to do but wait or modifying the Facebook SDK yourself.

This bug was fixed in the iOS SDK version 3.18

Didn’t have time to update for now but should be fixed for all by now. Changelog - Unity SDK - Documentation - Meta for Developers

alt text

Unfortunately the current Unity Sdk does not include this version. Neither does the 6.1 (currently in Beta)

alt text

Your best option is to wait for a fix if you’re not in a hurry. Otherwise you should just modify the code yourself.

Hope that helps.

EDIT: Should now be fixed.Turns out Facebook just released a new version (v6.2.1) of their SDK using this time version 3.2 of their mobile SDK.

Hi, I had the same problem and solved updating the Facebook SDK as described.
But I have another problem (I had to integrate a Unity game in landscape orientation inside another app in portrait orientation): now when the facebook login dialog appears, it’s correctly oriented in landscape, but if I rotate the phone in vertical, the login dialog (and ONLY the dialog, not the underlying game) gets portrait dimensions (width smaller than height) NOT rotating and goes offscreen.
Do you know if there is a way to “lock” the orientation for the facebook login dialog?