login with facebook without any plugin for phonegap - javascript

I want to make a facebook login button in my application using javascript SDK of facebook, the problem is when I tryed to login with facebook it opens the default browser showing an error telling url problem having issues with cross domain.
I would like to know if I can make the button without any plugin because when I search on google I always find plugins to make the facebook dialog be into the app and how to fix that problem to be able to load that dialog without having ajax communication problems.
I know to do this we need to have a facebook application to get the app ID and use the API with it but I'm using heruko hosting
I' need to know about the channel.html file how to use it to make cross ajax requests with the app.
thats all thank you for your help in advance.

I wrote a basic workflow for making a facebook login app using the childbrowser -
https://github.com/DrewDahlman/phonegapFacebookApp
That should point you in the right direction.

Related

Facebook Login and UIWebview

I'm currently developing an app that is essentially a single WebView that allows access to a specific website (terrible idea I know, but the decision comes from higher up); said website offers the option to login through Facebook with the standard Facebook Connect procedure.
The login process works fine in Mobile Safari but unfortunately when a UIWebView attempts to do the same thing after authorizing a blank page is displayed and nothing happens. This is of course because of the page actually being just a JavaScript that communicates with the original page through postMessage (I think!).
I tried searching and while this is a pretty widely recognized problem all the solutions I found are either not applicable or won't work. I found somewhere that it's possible to pass mode=redirect to the oauth URL to prevent the whole process to involve popups which sounds promising but as far as I tell it doesn't work.
Is there a way to make Facebook Connect work for a website inside a UIWebView? I'm considering the option of having the Facebook button call a special URL that I would then listen to inside the ap to trigger a native authentication process but unfortunately since my company is not the one developing the website so this kind of solution would be the least preferred.

feed dialog shows an error occurred when I use my appid.When I use FB developers example app id it works

I have an app on facebook. Through my site, I open, using JavaScript, a popup. The querystring appearing on Facebook developers site (https://developers.facebook.com/docs/reference/dialogs/feed/) which is:
https://www.facebook.com/dialog/feed?
app_id=458358780877780&
link=https://developers.facebook.com/docs/reference/dialogs/&
picture=http://fbrell.com/f8.jpg&
name=Facebook%20Dialogs&
caption=Reference%20Documentation&
description=Using%20Dialogs%20to%20interact%20with%20users.&
redirect_uri=https://mighty-lowlands-6381.herokuapp.com/
The popup works well and everything is ok.
When I change the app id parameter to my app id, it's not working and it displays "An error occurred...".
What is the reason for that?
Another question related, I moved to facebook feed dialog because the Facebook sharer didn't show certain images. Is it possible to make the facebook feed dialog look like the share option?
Thanks,
Make sure you specified App Domain and Site URL. Those have to point to the server where your Share Feed Dialog will be triggered from. As for testing it can point to local host.
Example:
App Domain: localhost
Site URL: http://localhost:12345/
Good luck!
Marta

PhoneGap App: FB Share via API without FB Popup

We plan on building a PhoneGap App and want to give the user the possibility to share information on Facebook.
We wonder if this is possible with the FB JavaScript SDK without leaving our app that means without having FB open its Share Dialog.
Well, and when it is possible does anyone know of an tutorial which kind of describes how we will do this?
If you ask for PUBLISH_STREAM permission from the user, there will be no dialog at all.

How to logout facebook - using code in rails application (Ruby on Rails Omniauth)

I tried to add more than one twitter and facebook accounts from my page via omniauth in rails.
Twitter working fine using force_login parameter.
But, facebook not supporting this.
i can add only one facebook account using /auth/facebook. After i tried to add new facebook account using /auth/facebook path then it returns to my home page only.
If i browse www.facebook.com in same browser then the login page not appearing. The lastly added facebook account page is opening.
when i logout from facebook in browser then i tried /auth/facebook path. its working fine.
So,
need to logout already opened facebook accounts in browser tabs, before i hit add facebook link in my page.
Can anyone help?
thanks.
by deafult, you cannot log in multiple facebook account within one browser unless you have a method to trigger browser(like private browsing-mozilla, incognito Window-chrome ) to let your user sign in. websites uses cookies to track their status.
however, facebook do provide auth_type=reauthenticate.
which the doc is here.
https://developers.facebook.com/docs/howtos/login/client-side-re-auth/
Any correct me if im wrong.

Google+ Sharing in iframe

I am developing a web application for PC/Tablet/Mobile phones, and I want to integrate Google+ Sharing onto it.
But seems that the url https://plus.google.com/share?url=http%3a%2f%2fstackoverflow.com has blocking iframes...
prove that it doesn't work: http://jsfiddle.net/6ML4d/
isn't there any other way to do that?
P.S The server side of my application is ASP.NET MVC and the client side is jQuery Mobile.
You can take a look at this chrome extension:
https://chrome.google.com/webstore/detail/pfphgaimeghgekhncbkfblhdhfaiaipf
It allows you to view your google+ notifications. The developer made it in some way possible to embed something on https://plus.google.com that normally isn't possible.
Refused to display document because display forbidden by X-Frame-Options.
See here for supposed solution
I have found that there are some pages on google servers which allow iframes, but they are not complete . (for example, if user is not logged in, again we have another problem)
So, the best choice is not using iframes!

Categories