How did Swarm integrate Facebook Messenger? - facebook

Our app requires Facebook to sign-up. Our most requested feature after our beta was messaging, and we noticed Swarm has a built-in button for instant Facebook Message that is essentially a pointer to a new message to said person in the Messenger app. We can't seem to locate any documentation on the feature in the Facebook SDK. Does anybody have a clue how they pulled it off? It would save us from a lot of development time if we could do the same!
http://i.stack.imgur.com/S1Rq2.png

Are you referring to the Message dialog?
If so, it's pretty easy to implement via the Facebook iOS SDK, and involves triggering
FBDialogs presentMessageDialogWithLink or one of the related methods (e.g. photos use a specific method, presentMessageDialogWithPhotos) - there's also a corresponding canPresentMessageDialogWithParams method to determine if triggering the dialog would work
Explanation and examples: https://developers.facebook.com/docs/ios/share#message-dialog
Reference docs: https://developers.facebook.com/docs/reference/ios/current/class/FBDialogs/
For Android it's pretty similar and uses FacebookDialog.MessageDialogBuilder, docs are here: https://developers.facebook.com/docs/android/share#message-dialog

Related

Facebook app id for website social plugins

I have like/share buttons on my website and am not currently using an appid. Finding information on whether this is a necessity for the above configuration is difficult to confirm. When going through the Facebook app "create" forms, I'm really confused by a lot of the requirements as it seems to be more focused around actual apps rather than websites, which login via fb etc.
In the past I have created an app for one of my other websites and I don't believe there was any verification/submission process at this point (about 2-3 years ago). Reviewing my old app configuration now I can see that it is not "live" - does anyone know whether Facebook implemented this submission process in the last couple of years, and then de-activated any live apps that were created prior to this?
I now want to setup a new app for my new website and I'm unsure what the different 'action types' mean and what I would need to simply use like/share buttons on the website. Could someone give me a quick run down of what I'd need and what they are?
Any other info/tips people can provide would be greatly appreciated. I'm finding that the like/share DO still work without the app, but sometimes the share button doesn't work properly (I have a feeling this is something to do with the app).
Thanks
If you are just using the Social Plugins, you don't need to have a Facebook App ID.
If you want more integration, it will be required. Creating an App ID is like registering your App, wether an iOS or Android App or just a website, so that you can make Graph API calls for it.
The easiest way to register your website is to go the quickstart: https://developers.facebook.com/quickstarts/?platform=web (or https://developers.facebook.com/apps). There you can type a name and follow the steps.
You can then follow the "Sharing best practices" (https://developers.facebook.com/docs/sharing/best-practices#tags) on how to use the App ID. For example, by including an fb:app_id meta tag on your pages.
There is a review process, since last April, but that is only needed if you use permissions for your App. If you just use the plugins, that is not needed.
Can you explain more what is exactly not working?
Update
The time you create a page the Facebook crawler does not know yet what the Opengraph data for that one is. This will happen after the first share, but if you want to ensure it is correct from the first share on, you can force a re-scrape.
This section explains how that works:
https://developers.facebook.com/docs/sharing/opengraph/using-objects#update
When an app triggers a scrape using an API endpoint This Graph API
endpoint is simply a call to:
POST /?id={object-instance-id or object-url}&scrape=true

Facebook App Center on Desktop Game

I've been developing a desktop PC game in Unity which connects to Facebook in order to post messages about the player's progress (high score etc). The chosen method of how the app integrates with Facebook is currently set to "Website with Facebook Login". Everything is already set up and working (Open Graph stories, action and types) but after trying to submit the app for review, it appears desktop apps are not allowed to be configured this way.
The question I am asking is, if desktop apps are not allowed to use App Center, what are the preferred methods of posting messages to a users wall? There is the option of using normal feed posting but it is my understanding that this approach does not allow custom stories and will only display a generic message.
Does anyone have experience with the matter or perhaps has integrated it in their own game / app in the past?
Just to clear up a misconception in the question, an app can appear in Facebook's App Center even if it doesn't publish anything to Facebook - it must be on a supported platform (iOS, Android, or Facebook Canvas), though. And an app that doesn't appear in App Center can still publish to the site, too. The two are not connected.
That said: The feed dialog is actually highly customizable, and relatively easy to integrate into any game that can invoke a Web browser. Check out its documentation for details.
Additionally, you can create highly structured messages using the Open Graph. Doing this requires you to get the user's authorization, probably using a Web dialog. You need to request the publish_actions permission to do so; a few games (case study here, e.g.) have had remarkable success building out appealing OG implementations.
None of this is really specific to the Unity SDK at this point, I'm afraid, as it doesn't currently have native desktop support (just iOS, Android, and web player). But I hope it's helpful.

Launch Settings app using private api

Since opening Settings.app with a prefs:// URL no longer works in iOS 5.1+, I'm wondering if I can launch Settings using private APIs?
NOTE: Not for the app store.
Using Private APIs
GitHub Project iOS-Runtime-Headers
Here are iOS Objective-C headers as derived from runtime introspection.
The headers were generated using RuntimeBrowser for iPhone.
Of specific interest to the Settings app, take a look at the Preferences.Framework.
I've never worked with this directly, but there seems to be other SO questions on the topic:
iOS Private API Documentation
Does anybody know how I can find the the headers for IOS5 Iphones/ipod. Jailbreak development
Get a screenshot while App is in background? (Private APIs allowed)
More...
Using URLs
According to this answer on SO, it is no longer possible to manually launch the Settings app using URLs.
Asked Apple through my developer account if there is a way to programmatically launch the WiFi Settings dialog. Here is the response:
"Our engineers have reviewed your request and have concluded that there is no supported way to achieve the desired functionality given the currently shipping system configurations."
If, however, you are using the native Twitter or Facebook SDK, then a dialog will appear asking the user to login if they are not. More information from this SO question, with example image below.
I don't have a particular answer. However, I would build on previous answer about Facebook or Twitter. I think, it make sense to disassemble Twitter or Social framework and find where this dialog is shown. If you will find this place, you can check the code behind "Settings" button.
There should be some API which switches to Preferences. However, it could be that code which does it lives in some service component which has entitlement, which you won't be able to get.

Canvas app using the FaceBook 3.1 API?

I used to develop a few FB apps in the past (using the old rest-ased api), and now I'm considering to make them actually usable again by porting them to the new 3.1 API.
Sounds nice, but for some reason this is way harder than I should be...
So here are few questions:
Is there any example of a canvas app using the 3.1 API? Google did not give me anything useful
Is there still a difference between iframe and FMBL canvas applications? In my app settings, I checked the fmbl-option, but when I'm back at the app overview page, it still says it's an iframe app.
The SDK mentions the getUser() function to get the user-id, but how do I request the necessary permissions for my app? When I do some googling, I find even another solution which calls a specific url and then performs a callback. This solution however doesn't seem to php sdk at all!
Where is the documentation of the php-api? The only usable thing I find is this: https://github.com/facebook/php-sdk which consists only a few lines of code. And I suspect this is for having a fb login-button on your own website, not for a canvas app.
Firstly, good luck, and best wishes - you'll need it. Maintaining Facebook apps is way harder than it should be, because Facebook doesn't believe in legacy support, changes things all the time, and deprecates things quickly and completely. As a (former) Facebook app dev myself, I can tell you there is only one constant: apps will die if you leave them alone. As an app developer, Facebook owes you no favors, and it is vicious when it comes to breaking apps.
As for specifics: as of June 2012, Facebook has deprecated and removed FBML and the REST API, and there is no longer any difference between canvas apps and iFrame apps. This isn't a soft, "you shouldn't use it" deprecation - it's a hard, "your apps are now broken" deprecation. All apps are now iFrame apps, as there is no longer any other way to build them. The docs on how to build a canvas/iFrame app are here, and there's an auth migration guide that may be helpful in conversion. Oh, and you'll need to get your app running on HTTPS too, if you haven't already.
As for the rest of it, it sucks, but the only way you're really going to be able to maintain and get your application working is using the Open Graph API. Using the PHP SDK, you just run $facebook->api('/graph/url/here') - for instance, to get user information, run $facebook->api("/$userid"). You get the URLs off of the Open Graph docs - just grab everything after the graph.facebook.com bit and pass it to api(). It's another learning curve, and (depending on the complexity/modularity of your code) is anywhere from a lot to a nightmarish mountain of changes, and there are no drop-in replacements. Sometimes you can use the old REST api, but I doubt that will last very much longer either. It's painful, but that's how it goes. You're at the mercy of Facebook, because it's their data.
Upgrading apps involves a shift in thinking: apps are now literally just webpages surrounded by the Facebook chrome. There is now no difference between an external website that uses Facebook's api to pull in information and an app that runs inside of Facebook. It's for that reason, personally, that I've shifted to just that for my own app - an external website that just happens to use Facebook for most of its posting/sharing/user info needs.
For authorization, you request permissions via OAuth, using any number of methods. There are docs on how to do that over on Facebook as well. Specifically for the PHP api, you generate a URL using getLoginURL() and then redirect to it. Facebook eventually redirects back to a URL you specify with info about whether they authorized your app and such, after which you can do a getUser(). If you want fancy/slick/user-friendly popup dialogs without a bunch of redirecting, the Javascript SDK is your friend.

Facebook app - implementing notifications

I'm writing a Facebook app which needs to send reminders to users at set dates in the future. When searching for how to implement these notifications I find a lot of talk about how Facebook removed app notifications and you now either have to use counters or send the user emails. Emails I understand, but there's nothing about "counters" in the graph API docs or the PHP SDK. Could someone point me in the right direction?
The old Facebook rest api had a method called "notifications.send" which is what I think you are referring to but that has been completely removed and you won't see any documentation on it from Facebook's end. You can view the old documentation through the wayback machine. There currently is no other good alternative to this old method besides email/Facebook messaging unfortunately.