Best Practices for FB and Google authentication and some noob questions

Hey All,

This is my first post. I am enjoying developing in Ionic.

Up to this point everything has been a breeze, and a joy to code in, but I have spent the last three days messing the facebook-connect-plugin.

I am doing most of my testing with the Browser so I can view the specific JS issues in Chrome. with the facebook-connect-plugin, there is some checking if you are in browser

Where I am at currently
following every Tutorial and StackOverflow on the subject I can find.
facing this error

Uncaught Error: [$injector:modulerr] Failed to instantiate module starter due to:
ReferenceError: facebookConnectPlugin is not defined
    at browserInit (http://localhost:8000/lib/ngCordova/dist/ng-cordova.js:2074:7)

while not including the JS for the plugin in index.html, but it’s not clear to my why I must if it should be injected.

when I do include it my errors are

launching FB SDK
index.js:172 Attempt local load:  <script src=​"phonegap/​plugin/​facebookConnectPlugin/​fbsdk.js" async>​</script>​
index.js:177 Uncaught ReferenceError: module is not defined
ionic.bundle.js:13217 Uncaught Error: [$injector:modulerr] Failed to instantiate module starter due to:
ReferenceError: FB is not defined
    at Object.facebookConnectPlugin.browserInit (http://localhost:8000/lib/facebook-connect-plugin/index.js:151:13)
    at browserInit (http://localhost:8000/lib/ngCordova/dist/ng-cordova.js:2074:29)
    at http://localhost:8000/js/app.js:88:27
    at Object.invoke (http://localhost:8000/lib/ionic/js/ionic.bundle.js:13282:17)
    at runInvokeQueue (http://localhost:8000/lib/ionic/js/ionic.bundle.js:13188:35)
    at http://localhost:8000/lib/ionic/js/ionic.bundle.js:13197:11
    at forEach (http://localhost:8000/lib/ionic/js/ionic.bundle.js:9168:20)
    at loadModules (http://localhost:8000/lib/ionic/js/ionic.bundle.js:13178:5)
    at createInjector (http://localhost:8000/lib/ionic/js/ionic.bundle.js:13104:11)
    at doBootstrap (http://localhost:8000/lib/ionic/js/ionic.bundle.js:10462:20)$injector/modulerr?p0=starter&p1=Referenc…3A%2F%2Flocalhost%3A8000%2Flib%2Fionic%2Fjs%2Fionic.bundle.js%3A10462%3A20)

The module is not defined error is why I question including the JS.

As I have spent several days, trying to get this to work, I now ask if I should go another route.

Main Questions

  1. Is the facebook-connect-plugin still a good way to go? Most info I find on it is about a year old.
  2. I see oAuth in ngCordova, but can I test this in the browser?
  3. What about OpenFB?
  4. What are you doing?
  5. Ultimately I want to authenticate Google and perhaps other services as well, what considerations should I make now?

Noob Questions

  1. Where, typically, in Index.html should one include Plugin’s JS files?
  2. How does this fit in with injection
  3. Should the facebook-connect-plugin/index.js come before the ngCordova/dist/ng-cordova.js in the JS Includes? And consequently is this the pattern for all ngCordova Plugins?