Unity - How to log into Facebook without SDK? - facebook

I want to see if I can make my Unity application login to Facebook without using the Facebook SDK. Instead, I want to use the Graphs API, because the SDK does not play nice with other plugins and has lots of baggage I don't need.
I'm sending a GET request from my Unity app, which uses the API for getting auth token:
https://www.facebook.com/v15.0/dialog/oauth?
client_id={app-id}
&redirect_uri={redirect-uri}
&response_type=token
From my knowledge, this is supposed to either open the redirect URL with the auth token attached, or prompt me to sign-in/approve this app logging in. It works well pasting this request into a browser and hitting enter.
However, when sending this request via Unity, I get an HTML file as response. Opening this HTML file shows a page where Facebook tells me that Facebook does not support this browser and tells me to go download Chrome or Firefox.
Has anyone managed to get Facebook sign-in to work without the SDK? Or any idea how to avoid this error and get redirected to the page as expected?
Thanks in advance!

Related

How to get data from Cordova's in-App Browser

I'm working on authentication for an Ionic 4 app. I'm using the in app browser plugin to login. After successful login an access token is sent back to the client. I can't figure out how to get the token from the In-App Browser to the app.
You can use an event listener such as :
this.browser.on('loadstart').subscribe(event => { this.checkForToken(event); })
Where checkForToken can look at your "event.url" and parse the token to be stored to localStorage or some other method to be used to login with once the in-app browser is closed.
Using events to listen for load start and stop was an awesome idea. I was, however, facing another issue. Google doesn't allow sign in using the In-App Browser and I really needed that. After asking around and looking at similar past issues I came across a Cordova plugin called BrowserTab. This was awesome as it's an instance/Custom Tab from chrome so it worked fine with google sign in. Another problem came up. You can't inject Javascript into BrowserTab and there was no way to programmatically close it once done. I looked around some more and that's when Deeplinks came to mind. I used the Deeplinks plugin and passed my access token as a parameter. When the user logs in, the BrowserTab redirects to a Custom URL scheme link for my app with the access token in the URL. Now it works perfectly. I've read somewhere that IOS is getting rid of Custom URL Scheme links. Luckily, it still has support for Universal App Links

Post image to facebook from desktop application

I have this desktop windows app written in C#
The user can post an image to his wall from the app. I have already created the Facebook app. In the previous version the win app would upload the image to my web site then the user was directed to https://www.facebook.com/dialog/oauth/ (via Process.Start(…) that would open the default browser) with my Facebook apppid and a redirect_uri and after authentication and obtaining an access_token the post image dialog would open. It all worked fine.
However, my question is if I could do these stages without a web site of my own, directly from c#.
I have seen plenty of examples but most of them refer to aspx, php and javascript but after all this is a few http request so I think it should be possible.
I think the main problem is how to get an access_token if there is no web page that the user is directed to after login.
I have seen an example using the webbrowser control but it wasn't very clear. And also, if possible I rather that the user would login using their default browser where they are most likely already logged in to Facebook and don't need to enter user and password just for this.
Also, is it possible to upload an image to facebook directly from my app without putting it on some public url first.
Any help would be appreciated. Thanks

How to open the Facebook app during OAuth in Ionic?

I just got my app working with $cordovaOAuth from ng-cordova and I've read and understood all from Nic Raboy's post (http://blog.ionic.io/oauth-ionic-ngcordova/). It works fine: both the inAppBrowser and the authentication itself.
But I want to take it one step further: how can I redirect the OAuth call to the installed app itself? For example, if I was using Facebook OAuth, how can I open the actual Facebook app (if installed - how to check it?) instead of a browser?

meteor - phonegap facebook oauth

so i have a meteor app, and i'm using facebook login (and google etc) for user authentication.
and i'm using MeteorRider which is basically "hijacking" the DOM from my meteor app, this way i get also a phonegap app.
So when using web and clicking on the facebook login, its working great.
but when using the phonegap app, its not working. its making an ouath call (opening a browser and do all the process but does not automatically close the browser and bring up my app) but then redirect to my app in the browser.
i'm still trying to figure how the two works with each other.
do i need to do this authentication using phonegap api or should i handle it using meteor api?
I use this for any oauth requirements in phonegap. https://github.com/oauth-io/oauth-phonegap
It handles closing of the browser etc.
I just released a package to fix this. It uses the InAppBrowser plugin to load the popup, listens for the auth token, closes the popup and logs in/creates account.
https://atmosphere.meteor.com/package/phonegap-oauth

Facebook Login with Blackberry Webworks

So I'm trying to build a Blackberry Webworks that integrates with Facebook.
I'm trying to use the Javascript API provided by Facebook, but I'm having some issues with logging in.
The typical "FB.login" function creates a popup, and this doesn't show up on a Blackberry so using that is no good.
Another issue is that I have no idea what to set as the redirect_url for the oauth login, because Webworks pages are referenced locally (local://index.html), and the API rejects this as a valid url. (I've also tried just index.html, but this also causes an error)
And finally, I have no idea what to use for the Mobile Website URL on the Application settings and not sure what other settings to use. Since users will be coming from a Webworks app, Facebook is rejecting login requests if I try to call the oauth url directly. (191 Error).
I figured out the only viable way to do this is to have a web server that will go through the OAuth2 authentication process documented by Facebook.
What you can do in Blackberry is open a new window or to use a Blackberry BrowserField that links to the web server, that way, your page will be able to get the oauth token that you can use to make Graph API calls.