NPM - Cordova and logging into Facebook - facebook

I'm wondering what the best way to generate a Facebook login process would be if I created a Cordova/phonegap project using npm.
A bunch of the Phonegap Facebook plugins appear to be broken or outdated. I've spent probably 3-4 hours trying to create a working 'login' example that doesn't require using a URL (since the Phonegap/Cordova application will be an 'app', not a website).
Basically, is there any easy way to receive an access_token or any useful 'token' in Cordova/Phonegap? Again, the app is not a 'Web' App, so there will be no URLs to point to.
Thanks, guys (and gals)!

Have a look at https://github.com/Wizcorp/phonegap-facebook-plugin You'll have to install it yourself to your generated project.

Related

How do I use Facebook Login and Facebook App Events in the same Flutter App?

We are trying to use Facebook Login and Facebook App Events in the same Flutter app, but we keep running into issues trying to combine these two pieces of functionality.
First off, there doesn't seem to be a single Flutter plug-in that deals with both, which means using individual ones. At first, we implemented just Facebook Login, for which we successfully used the following plug-in:
flutter_facebook_login
It served us well until we tried add a plug-in for Facebook App Events, but we discovered that due to the age of flutter_facebook_login (last updated on Sep 2019), it uses an older FBSDKCoreKit than the newer plugins for app events.
The simple solution seemed to be using a different plugin for Facebook Login, but after trying a couple of others I get a literal cascade of dependency errors in countless other plugins we use.
So what I'd like to know is this: has anyone else successfully combined Facebook Login with Facebook App Events in the same app. If so, which plugins do you use?
Please see the most recent release of Facebook App Events v0.12.0 and the PR which also address you same question: it is suggesting that you might have better luck trying flutter_facebook_auth plugin to support both of them together.

Full Facebook PHP SDK app (no JS SDK). Is it even possible?

In my work we often need to build Facebook apps in the form of Facebook Canvas and Website. These apps are available on Facebook direclty (an iframe) and as mobile versions (outside Facebook, in the browser).
We are working with a code base which mixes Facebook JS SDK (authentication and authorization) with PHP SDK (API calls). I find it rather dirty, and not easy to understand for people freshly working on the projects.
It's inconvinient to make API calls with JS, and making them with PHP forces extending access tokens. Authenticating user with JS SDK involves client-side redirects which are ugly to be honest, as they usually occur moments after the current page starts rendering, and so on...
I googled a lot about separating these two SDKs but did not find a clear answer to my questions:
Is it possible to create Facebook app (Canvas, Website) which bases ONLY on PHP SDK? Check login status, login, permissions, making API calls, etc. Would signed request be enough?
Is JS SDK the only full-proof way to determine user's login status at any time?
This link seems to describe what I'm thinking of, however the docs are rather brief (which seems to be a problem of Facebook documentation in general). Can anyone suggest other sources that might help? Does anyone have experience with builing FB aplications based only on server-side?
Thanks.
EDIT:
The link I posted above covers the case of not using ANY SDK, so no, it's not what I'm looking for.
You can even create an App WITHOUT any SDK - with simple CURL calls, for example. So yeah, it is indeed possible to use the PHP SDK only, but the login process is much better with the JS SDK (no redirection needed) and you canĀ“t auto-refresh a user session like it is possible with FB.getLoginStatus afaik.
In short, i would not recommend it, the JS SDK is the very best way to authorize users and refresh Access Tokens. I would only use the PHP SDK (or simple CURL calls) for stuff that MUST happen on the server, and for stuff that includes using the App Secret, for example.

What's the correct way to authorize PhoneGap application to the Facebook?

I spent a while already to fix annoying issue with Facebook in PhoneGap app. And still a lot of things goes wrong with that. The thing is that I use Appery.io and Facebook plugin.
This is how my Facebook console looks now:
I suggest that localhost might be a reason of the issue. However, I got it into Facebook_Helper.js:
Everytime I try to sign in with FB account, I get the same error at the child window:
So what I've got is that app is authorized at this moment indeed, because there's a menu button at the navbar that allows me to navigate through FB profile:
The first issue lies in that the child window never gets closed automatically once user submitted Sign In form. And the second one is that I can't get the access token to the app directly. I know I'm doing something wrong, but I spend more than a week on that and nothing was clarified.
Honestly, I've no idea why it's not working. I saw a lot of apps written in PhoneGap that use the same authorization too, and they work as it should. Will be appreciate if you take a look into that and, maybe, advice something.
First, I don't see iOS or Android in your developer.facebook screenshot.
Second, you should implement native facebook integration if you are developing an app, if I understand correctly from your code, you are trying to handle only web browser version of authentication. Native integration is both the suggested way by facebook and platforms and better experience for end users. If users have facebook app installed, authenticating over fb app is more secure after all..
You can use a cordova plugin for facebook integration, here is one of the plugins (I am one of the authors): cordova-facebook plugin

Meteor + Phonegap

I'm beginning to develop a Meteor App using Phonegap, however I've come to a stumbling block on GeoLocation and Facebook Oauth. How do I extract native GeoLocation information from PhoneGap and transfer that to Meteor, and how do I create a native Facebook Login from the app as well?
I have made it working,
you just need the www folder of cordova bundle app,
and then create a hello world cordova app and replace your www folder in it.
Add plugins you need manually,
Here is my app
https://play.google.com/store/apps/details?id=com.youiest.tapmatrix
https://itunes.apple.com/us/app/tapmate/id774935608?mt=8
but yes, I did not succeeded in create facebook native login with the meteor official way.
I have been able to make facebook native login work.
You just need to add official cordova plugin for facebook and configure it in mobile-config.js
In case of trouble, please follow tutorial here

Facebook Login with WebWorks

I have been trying for some days now to login to facebook via a webworks application, I undesrtand that the FB.login can't work beacuse of a popup, and the oauth login has to go through a web server, I am currently trying to implement this plugin
https://github.com/rsweny/ChildBrowser-plugin-for-BlackBerry
but the readme file isn't really clear about how to implement, I understand that you need an ext directory in the app folder but not sure if I need to add something to the config.xml file or to any other.
Please help!
Thanks,
Jose.
I created some examples of how to integrate your app with Facebook, Twitter, and foursquare via OAuth. They're targeted for BlackBerry 10, but should work on earlier versions as well.
Note: I'll be updating them (for BlackBerry 10) to make use of the new ChildBrowser API.
OAuth Samples are available on GitHub # https://github.com/ctetreault/BB10-WebWorks-Samples