Does the iOS Facebook in app browser behave differently to Safari? - c#

I've just taken a Facebook app live (ie: it's a web app that lives at apps.facebook.com). The app is a simple form that allows you to vote for one of four options. When submitting the form for the vote we also capture the FB ID in order limit the user to 4 votes per day.
When testing this app in sandbox mode as well as live in any browsers, the app functions fine. It even has exception handling in the edge cases where the user is not FB authenticated etc.
The issue we have encountered is that when a user visits the app from within the iOS Facebook app, the link opens within the Facebook in app browser (based on the iOS UIWebView component I believe). When using it from this environment, when the form submits our server is producing a 500 error.
Now I know that the 500 error will be nothing to do with facebook since it is our application code, but my confusion arises from the fact that this only happens from the Facebook in app browser. We are currently going about trying to determine the nature of the 500 error (we do not have access the production environment and custom errors have been switched off).
My question is this: Does the Facebook in app browser behave differently or do things differently than the standard UIWebView or iOS Safari?
I am thinking of differences such as interfering with POST data, clearing FB login credentials etc.

In short yes the Facebook in app browser does behave differently than the standard UIWebView and iOS Safari web browser.
The Safari web browser and the UIWebView do use different user agents.
The Facebook embedded browser doesn't seem to post hidden form values. And I can't seem to find any debugging tools for the embedded browser used in the iOS app.
I might not be 100% true on this one but i think Facebook might still be using this browser for the iOS app. But support for this library has been discontinued and has not been updated in over 2 years.
https://github.com/facebook/three20/wiki/Using-integrated-web-browser-via-TTWebController
So in short the answer to your question is Yes, but finding a solution for this issue is another story.
I haven't found anything yet...
Good Luck!

Related

Show notification through browser in ASP.NET

I'm creating a Silverlight application which can push notification to other users and I want to display the message to the Browser (my users use IE and Firefox to access my website). I noted that some web browsers such as Chrome, Firefox, IE support display Notification when we access to websites which has notification feature. So how can I do this for both Firefox and IE like this? I'm trying to find the solution but due to my quite bad English I still couldn't. Thanks alot.

How to post URL on friend's Facebook wall?

I am creating Windows 8 app with C#/XAML. I want to share URL to logged in user's friend. Facebook has removed ability to post to friends walls via Graph API after 6th Feb, 2013. Facebook recommends to use feed dialog, but that dialog can be used with the JavaScript, iOS, and Android SDKs ONLY.
So how can I achieve this in WinRT ?
UPDATE 1
I found there's one more thing available that's URL Redirection. So I need to use WebView (which is one of worst control in WinRT) temporarily to open that URL and user will press "share". This way kills the UI/UX :(
UPDATE 2
I tried to use the URL Redirection, but I am getting error stating "An error occurred. Please try later". I searched about that, I tried all the ways like sandbox mode, double checking app ID but nothing worked for me. When I use app ID of graph api explorer it works.
Working
https://www.facebook.com/dialog/feed?app_id=145634995501895&display=popup&link=http://stackoverflow.com&name=Stack Overflow&picture=http://cdn.sstatic.net/stackoverflow/img/apple-touch-icon#2.png&redirect_uri=https://developers.facebook.com/tools/explorer&description=Stack Overflow is a question and answer site for professional and enthusiast programmers.&to=100000692924752
Not working
https://www.facebook.com/dialog/feed?app_id=159248604260839&display=popup&link=http://stackoverflow.com&name=Stack Overflow&picture=http://cdn.sstatic.net/stackoverflow/img/apple-touch-icon#2.png&redirect_uri=https://developers.facebook.com/tools/explorer&description=Stack Overflow is a question and answer site for professional and enthusiast programmers.&to=100000692924752

How to authorize my app with Facebook

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.

Struggling to understand the structure of the Facebook API

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.

Redirecting to device settings

Say I have a mobile optimized website which runs with a lot of javascript on it to create awesome effects, and a user enters the website via a mobile browser which doesn't have javascript activated.
Is it then possible to (through a button click) redirect that user to his/hers browser settings?
You need to have JavaScript activated in order to browse this site properly.
Click here to change your settings
In principle, you can create an intent: URL that references an ACTION_SETTINGS Intent, though I have not tried this. Off the top of my head, the simplest way to construct that URL is to generate a scrap Android project and call:
Log.d("Something", new Intent(android.provider.Settings.ACTION_SETTINGS).toUri(Intent.URI_INTENT_SCHEME));
then check LogCat for the URL that you would put in the Web site. Of course, this URL will only work on Android devices.
I only know Windows Mobile (and there, only up to v6.1), but I would guess your clients would have to have some app of yours prior installed to access features of the device itself.
If websites could access a device's features, it would be viewed as a virus.

Categories

Resources