Unity FB SDK on iOS: Problems with FB.Feed functio

2019-08-17 14:56发布

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

1条回答
ゆ 、 Hurt°
2楼-- · 2019-08-17 15:51

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.

查看更多
登录 后发表回答