I am trying to embed Facebook comment box in a windows 8 store app. Is it possible to directly integrate the comment box or are there any other alternative solutions?
What I am trying now >>>> create a web page and add the Facebook comment box to webpage. Then access the webpage that I created through a Webview control. But when I try to login to Facebook using the comment box's link, it will not open the login dialogue inside the webview but it opens the browser where my windows 8 Store app pulled to the background.
I would recommend that you use the Facebook API, as recommended by another SO user answering a similar question
There is a Facebook API for Windows 8
You can find an example on Github here
I haven't tried this API, but did a WPF app using a similar API and it's usually straight forward.
If you would like to, and I know you didn't ask about that - this is just a tip, there is a web authentication broker in the WinRT API's to enable single sign on (SSO) connections to OAuth providers like Facebook etc.
You can find a sample here
Hope this helps, best of luck.
Related
I am developing an UWP app for xbox one. Is it possible to share a link from my app to my friends (Facebook, Twitter...etc)?
Just take Facebook as an example, if you want to share a link from your app to Facebook, you can try to use the Facebook api. This Windows SDK for Facebook teaches you how to start and you can use FBSession.ShowFeedDialogAsync() method to share the link. About the specific steps, you can refer to this document.
My question is simple, but I cannot seem to find the answer with Google. I'm working on a Windows Phone 8 app and I would like to offer the possibility to share content with certain people in private. I will add a feature to send by SMS, but I would also like to offer the possibility to send a private message in Facebook.
There is a Facebook app for Windows Phone 8 and I wanted to know if there is a way with "App-to-app" communication to have the Facebook app send the message for me. This way, the user could edit the message and choose who to send it to, without my app having to manage this for him. I think it would be a better user experience than using the Facebook API since it would be consistent.
I looked online and there is a way to make a post. However, that's not what I want since my app handles a financial matters. Is there a simple way to do that ?
It depends not on your App but the Facebook App - if it supports such a feature.
In Windows Phone you can for example associate files and Uri's with certain Apps - MSDN source. By this it is possible (I think somehow) to pass a file (message) to other App (if that App supports it). Other problem may be where to save that file - maybe some webservice as IsolatedStorage is a bad idea.
It will be hard workaround, but surely depend mostly not on your App.
In this case I think it will be better to use Facebook API in your App.
Use Facebook to do post function like below
await Launcher.LaunchUriAsync(new Uri("fb:post?text=foo"));
Or you need implement an OAuth flow to get Facebook token then do Post by Facebook post API
https://graph.facebook.com//v2.0/me/feed?message=foo&access_token={TOKEN}
I think these are the possible ways to achieve what you want.
I know I have seen apps that log me in using Facebook but never present me with an authorization screen. I can not, for the life of me, figure out how to do this with Windows Phone 7. The best I have been able to get is using the Facebook for C# SDK to get the authorization screen in a WebView. This looks hideous and the page does not even appear to be mobile ready.
I have searched high and low for an answer and have found nothing. Wondering if anyone can point me in the right direction to getting this to work?
Yes, I also saw this kind of apps (e.g. Spotify prompts you to enter your Facebook account credentials rather than using the normal authorization flow). My best guess is that they either some kind of premium partners and have access to some private APIs or they use custom authorization flows (e.g. when you authorize an app on a website, the system saves authorization key in the database. The same app id/secret is then used in Windows Phone app and all you need to do is to type in your email/username in order for the system to locate authorization key that was saved earlier).
I also don't like the approach of displaying Facebook login/auth using WebBrowser control (mostly because of UI inconsistency) but I'd say that this is still the way to go in most cases (because this is the official and recommended way of authorizing the app and all other approaches seem hacky for me and also have their disadvantages).
You will want to be using the "server-side authentication" approach. The following document describes how it works: Server-side authentication (read also OAuth Dialog documentation for how to configure the authentication dialog). You can change the way the UI looks by passing a display parameter (either to touch or wap).
Please note that display=touch is currently broken in Windows Phone - Facebook always falls back to wap which is deprecated and will be removed as per July 2012 update (corresponding case: Facebook API can't be used with Windows Phone apps). It's also among known issues on Facebook C# SDK project page: Facebook C# SDK - Known issues.
Hope this clarifies things a bit.
Ultimately I want to create a desktop app that allows users to update their own status, view status' of their friends, update pics etc. - basically a lot of the functionality the facebook website provides. Through looking through some tutorials and sample projects it seems that an app must be created for the facebook account. Now is this the facebook account of the developer (i.e. mine) - which will provide an API key that will allow any other user to log in?? Does every desktop project need to authenticate the user through a facebook dialog window to take the users' credentials?? Where does OAuth fit into this?? If anyone can shed any light as to the structure of the facebook api and the ways in which I can grant this functionality from say a WPF C# app for example I would really appreciate it.
EDIT: Before complaints of a potentially huge question or too 'vague', my question is specific to the integration/use of the facebook API in desktop applications - not how to then retrieve status feeds etc. I'll work that out myself.
Per Facebook documentation, all desktop apps will need to implement some form of web browser integration, whether embedded within the desktop app or controlled.
See: http://developers.facebook.com/docs/authentication/
Desktop Apps
Our OAuth 2.0 implementation does not include explicit desktop app
support. However, if your desktop app can embed a web browser (most
desktop frameworks such as .NET, AIR and Cocoa support embedding
browsers), you can use the client-side flow with one modification: a
specific redirect_uri. Rather than requiring desktop apps to host a
web server and populate the Site URL in the Developer App, we provide
a specific URL you can use with desktop apps:
https://www.facebook.com/connect/login_success.html.
Don't worry it took me two solid days of trial and error and re-re-reading of the documentation on authentication to finally "get" it.
I was wondering, is there a way I can create an application which for example updates both my facebook and my twitter at the same time?
So for example I have a GUI which has a similar interface as my facebook profile (or whatever), and I want to post a comment on my profile through my GUI, so I write a line in a GUI textbox, press apply and it adds the post to my facebook profile and at the same time to my twitter for example.
I know this sounds silly since u can media link both pages, but that's not my true goal, I'm just wondering if this is possible so I can extend it to other facebook services.
See
facebook API
twitter API
And (.NET related) :
C# Facebook API
C# Twitter API(unofficial)
Yes, it is definitely possible. You would have to use the APIs exposed by Facebook and Twitter. You can then post let's say status on both twitter and facebook by calling update status related APIs of both Twitter and Facebook on the apply button click event.
You can use this for Twitter and this for Facebook both are C# clients for Twitter and Facebook respectively.
Yes it is. I don't see how this wouldn't be.
Also, I suggest you have a look at Seesmic Desktop for an application that does that which use Silverlight.