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

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

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.

Related

Fetch App referrer when iOS App opened from other iOS app

Did some research but haven't found way to detect app referrer in iOS app(App is based on Swift Language), Flow is
Someone has posted some web link on FB i.e. link is
https://example.com.
Assume our iOS app is already installed on user's
device, hence when someone click on that link it will trigger ourapp(via
deep linking flow), and its working fine but also would like to know
source from which app user land to our iOS app.
Looks like in android there is way to achieve this using AndroidAppUri but haven't found way for iOS, let me know if anybody has any suggestion\input.

Opening Facebook Page Results in Force Close

I'm making a mobile game using Unity3D 5.1.4, and inside my game I'd like the players to be able to open up my Facebook fanpage.
I have implemented it using this code:
Application.OpenURL("fb://page/442219965978230");
On Android it works fine, however the problem is on iOS.
I tested it on my iPad Air 2, iOS 9.2.
The Facebook app opened for a short moment, but then closed by itself.
This happens ONLY when the user is already logged into his Facebook account.
There was no error log when I checked in XCode...
After trying other games, I found out that opening Facebook would show a permission dialog "[Appname] wants to open Facebook", while in my game that dialog was never shown.
Is this what's causing the force close? Or something else?
I suspect it has something to do with iOS 9, isn't it?
If so, what do I need to do to fix it?
Change page to profile. For some reason, this is the fix for this problem.
Application.OpenURL("fb://profile/442219965978230");

Unity and Facebook - iOS won't post, android does

having a bit of an issue that I haven't been able to find anywhere. I've created a game using Unity and the Facebook SDK for Unity. It works great in the editor, great when pushed to android....But when I try an iOS install, it won't post onto my timeline or anyone else's and invites don't work....But the android version does.
It brings up the dialog like it should, looks like it's about to invite/post, then just goes back to the game.
I'm using Unity 4.3.4, Facebook SDK for Unity 5.0.3 and Xcode 5.1.
Any help would be appreciated.
EDIT: Some additional news. Facebook SDK for Unity has a tutorial attached to it where they have a pre-built project called Friend Smash to show you how the SDK works. I just ran the completed project through Xcode and pushed it to my iPhone and have experienced the EXACT same issue. Invite appears to be sent (even appears on the screen saying "request sent") and it appears to post my score to Facebook, but again nothing appears on Facebook.
Looks like this was my stuff up.
Looks like my request wasn't being given a Post ID. In checking my code, I had written "actionlink", instead of "link" in the "onBragClicked" method which fouled up the process....Yet somehow didn't screw up my android build.
Anyway, thanks for viewing.

HelloFacebookSample not working as expected, making facebook app to crash

I'm using sample codes (HelloFacebookSample) from "facebook-ios-sdk-3.5.2.pkg".
When I try to post status update, it fails and shows me alert.
with text "Beta Feature", "This feature is not available presently"
And at the above stage, if you lock your phone and unlock it, tada! facebook app crashes.
Side note:My device is running 6.1.2. And I dont understand when how/what/when app decides to show native sharing dialog or facebook app sharing dialog or just safari.
The Share Dialog (the one you're seeing) is currently in limited beta. So you're probably hitting that scenario where the dialog is presented by the SDK but the server flags you as not being in beta when you submit the share. The native share dialog is presented by the HelloFacebookSample app if you have the latest Facebook for iOS app (6.0+).
You can check this doc for more pointers on sharing and how you can use it in your app:
https://developers.facebook.com/docs/howtos/share-dialogs-ios-sdk/
The HelloFacebookSample app is primarily showcasing the Share Dialog.
That said, if you want to successfully run the sample for now, I suggest you temporarily modify:
FBAppCall *appCall = [FBDialogs presentShareDialogWithLink:urlToShare
...
}];
To:
FBAppCall *appCall = nil;
In the postStatusUpdateClick: method. This will post a status update using the either iOS6 Share Sheet or using a Graph API call.
This is a beta feature. Facebook lets you enable beta features in debug mode using:
[FBSettings enableBetaFeature:FBBetaFeaturesOpenGraphShareDialog];
[FBSettings enableBetaFeature:FBBetaFeaturesShareDialog];
But it looks like Facebook just took the share dialog out of beta:
https://developers.facebook.com/blog/post/2013/05/20/sharing-made-simple-for-ios-apps/

Launching a Facebook page from an iPhone app via QR code

I'm trying to create a QR code that launches a Facebook page from the app, rather than the browser on both Android and iOS.
Creating the code with fb://page/<page id>, works perfectly on an Android.
This was also supposed to work with iOS's Facebook app, but I think since Facebook updated their app recently from a HTML5 version to a fully native iOS app, that functionality has stopped working. It indeed opens the Facebook app, but it does not go to the page.
Has anyone else seen this happen since the app was updated a few weeks ago? And what string would I have to use to create a working QR Code for iOS's Facebook app?
We finally figured it out. FB changed it to fb://profile/ instead of "pages". It works across both platforms.

Resources