I want to integrate Facebook (like), Twitter, Google+ (bubble button) into my Android app which is developed using jQuery Mobile within PhoneGap, so that users can post content from the page on their walls. Nothing is working for me.
For Facebook, phonegap-plugin-facebook-connect works well although integration is more convoluted than it ought to be.
I am able to solve it in the following way:
1) When User clicks Google, Facebook, Twitter etc, I open a link (http://www.mywebsite.com/login/google) in InAppBrowser (PhoneGap native function, no plugin required) if Google is clicked
2) When the link is opened, my server redirects to Google.com and user sees Google login page.
3) User authenticates itself with Google and Google redirects with the token to my server.
4) Now my server uses that token to create some accounts, logs, do some more operations and then redirects to a url with information required by my phone application.
E.g. - It redircts to http://mywebsite.com/login/google/successful?token=<>&query-string-parameters
5) InAppBrowser is listening for URL changes and when it finds a URL with the above pattern, it takes over, strips the URL, parses the information sent with the URL and then closes InAppBrowser.
Here is a blog post describing how to integrate twitter and facebook to phonegap
The thing is that iframes on phonegap have a weird behavior, and twitter and facebook oAuth require that, so you need to use ChildBrowserPlugin
© 2022 - 2024 — McMap. All rights reserved.