Skip to content
Browse files

Fix android instructions so that the plugin name works

  • Loading branch information...
1 parent 3aee108 commit f4155507ffb55501a4f8353a16429e6c56bff9e4 Dave Johnson committed
View
11 .gitignore
@@ -1,2 +1,13 @@
.DS_Store
test/www/*.js
+*.pbxuser
+!default.pbxuser
+*.mode1v3
+!default.mode1v3
+*.mode2v3
+!default.mode2v3
+*.perspectivev3
+!default.perspectivev3
+*.xcworkspace
+!default.xcworkspace
+xcuserdata
View
9 .gitmodules
@@ -0,0 +1,9 @@
+[submodule "lib/connect-js"]
+ path = lib/connect-js
+ url = git://github.com/facebook/connect-js.git
+[submodule "lib/facebook-ios-sdk"]
+ path = lib/facebook-ios-sdk
+ url = git://github.com/facebook/facebook-ios-sdk.git
+[submodule "lib/facebook-android-sdk"]
+ path = lib/facebook-android-sdk
+ url = git://github.com/facebook/facebook-android-sdk.git
1 lib/connect-js
@@ -0,0 +1 @@
+Subproject commit afc3505586df7956c670e07d1319d2c5a996c5c2
1 lib/facebook-android-sdk
@@ -0,0 +1 @@
+Subproject commit 5d44d0ce3df029356796bfce4e5356f1db76410a
1 lib/facebook-ios-sdk
@@ -0,0 +1 @@
+Subproject commit 3c88fd42dfbc4738688e5ee63f49ff753b562f75
View
2 .../com/facebook/phonegap/ConnectPlugin.java → .../com/phonegap/facebook/ConnectPlugin.java
@@ -1,4 +1,4 @@
-package com.facebook.phonegap;
+package com.phonegap.facebook;
import java.io.IOException;
import java.net.MalformedURLException;
View
15 www/pg-plugin-fb-connect.js
@@ -10,11 +10,20 @@ PG.FB = {
PhoneGap.exec(null, null, 'com.phonegap.facebook.Connect', 'init', [apiKey]);
},
login: function(a, b) {
- b = b || { perms: '' };
- PhoneGap.exec(function(e) { // login
+ var session=null, key='pg_fb_session', success=function(e) {
FB.Auth.setSession(e.session, 'connected');
if (a) a(e);
- }, null, 'com.phonegap.facebook.Connect', 'login', b.perms.split(',') );
+ };
+ b = b || { perms: '' };
+ // TODO: also check the session expiration probably
+ if ((session = localStorage.getItem(key))) {
+ success({'session': session});
+ } else {
+ PhoneGap.exec(function(e) { // login
+ localStorage.setItem(key, JSON.stringify(e.session));
+ success(e);
+ }, null, 'com.phonegap.facebook.Connect', 'login', b.perms.split(',') );
+ }
},
logout: function(cb) {
PhoneGap.exec(function(e) {

0 comments on commit f415550

Please sign in to comment.
Something went wrong with that request. Please try again.