Unity FB SDK on iOS: Problems with FB.Feed function
Asked Answered
D

1

0

We started using Facebook's SDK in our game which was made with Unity.

We are trying to post "brag posts" when people win against their friends, and we use FB.Feed with the friend's ID in the "to" parameter.

In iOS devices running with an older FB app version, a small popup opens up inside the game - and it works perfectly well.

However on devices running the newest FB app version, when we call this function the FB app is opened, completely losing focus from our game, and an incorrect brag post is shown and attempts to post it on the user's wall (instead of on the friend's wall).

Anyone else had this problem and figured out how to fix it?

Thanks

Daigle answered 9/1, 2014 at 14:11 Comment(0)
J
4

I'll look into whether the feed dialog changed in newer version of the facebook app. In the meantime here's a workaround. In the exported xcode project, open FbUnityInterface.mm and go to line 46.
You should see the code

self.dialogMode = NativeDialogModes::FAST_APP_SWITCH_SHARE_DIALOG;

change that to

self.dialogMode = NativeDialogModes::WEBVIEW_DIALOG_MODE;

This will force the sdk to use webview dialogs instead of the one from the facebook app.

Jahdiel answered 9/1, 2014 at 19:20 Comment(3)
You my good sir, are awesome. I'll check your solution next week when I get back to the office and mark this as the correct answer if it works.Daigle
Excellent solution, I've added a Unity function that changes the native dialog mode and it solved my problem (plus we prefer the web view dialog)Daigle
I'm having this issue in Unity as well, but on a Facebook canvas app. Oddly, I get BOTH dialogs. They're functionally the same, but one stops the game (which I want) and the other doesn't. I only want to use one. Where can I set this in the Unity project? Is that even possible?Anthropomorphous

© 2022 - 2024 — McMap. All rights reserved.