mrienstra / barchat

BarChat
0 stars 0 forks source link

Facebook Login #1

Open clearhythm opened 10 years ago

clearhythm commented 10 years ago

Changing this ticket to just relate to "login" since there's a separate ticket for logout. Mikey coded login, still need to test Mikey's native app on my iPhone.

clearhythm commented 10 years ago

Note: This ticket also relates to all aspects of login (specifically, Facebook AND Parse if we continue to use Parse)

clearhythm commented 10 years ago

Steps to get Login Tested

  1. Start with a functioning FB login Cordova plugin on a phone
  2. Save the www directory copy as a backup
  3. Empty www directory
  4. Copy everything from build directory of our repo into www
  5. Rebuild the app and put it on the phone and test the build
clearhythm commented 10 years ago

Test results revealed that code works in iOS sim (tho only partially since you cannot ask for publish permissions) and totally bork'd in native iOS app. Looks like we're back to drawing board on this, story is not re-estimated at Medium (or more)

clearhythm commented 10 years ago

Mikey has suggested we test with this more minimal framework: https://github.com/mrienstra/fb-fcp-parse

And possibly only request 'basic_info' as needed

mrienstra commented 10 years ago

Todo: Down the road, we should be listening to some of these events: https://developers.facebook.com/docs/reference/javascript/FB.getLoginStatus#events

clearhythm commented 10 years ago

occasionally, after doing dev work with our app for a while, I'll try to reload the homepage "Mixing Your Drinks" and it will fail to redirect. Looking at the console right now, I see the following JS error Uncaught SyntaxError: Unexpected token ILLEGAL from http://connect.facebook.net/en_us/all/debug.js

Logging this here, since this issue may continue to appear for other users, but I'm not sure what's causing it.

clearhythm commented 10 years ago

Clearing my browser cache and my localStorage right now (then refreshing the page) fixed the problem. not sure why.

mrienstra commented 10 years ago

Commit d9282bdbf9 got FB login working in Phonegap.

mkdir cordova
cd cordova
git clone https://github.com/phonegap/phonegap-facebook-plugin.git
cordova create barchat com.sippingslug.barchat "BarChat"
cd barchat
cordova platform add ios
cordova -d plugin add ../phonegap-facebook-plugin --variable APP_ID="637656759644763" --variable APP_NAME="BarChat"
cordova plugins add org.apache.cordova.inappbrowser
cordova plugin add org.apache.cordova.camera
cordova plugin add org.apache.cordova.statusbar

[replace files in www directory with build directory]

cordova prepare

[open platforms/ios/BarChat.xcodeproj , "run"]

mrienstra commented 10 years ago

If we want our sessions to last longer, there are instructions on that here: https://developers.facebook.com/docs/facebook-login/access-tokens#extending

mrienstra commented 10 years ago

A better way to revoke app permission (for development / testing purposes):

https://developers.facebook.com/tools/explorer/637656759644763/?method=DELETE&path=me%2Fpermissions&version=v2.0

Compare to: https://www.facebook.com/settings?tab=applications , which requires a reload (if you keep it open).