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

戏子无情 提交于 2019-12-13 03:00:54

问题


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:


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.



来源:https://stackoverflow.com/questions/21022557/unity-fb-sdk-on-ios-problems-with-fb-feed-function

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!