Skip to content

Commit

Permalink
Merge branch 'master' of github.com:wizcorp/phonegap-facebook-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
aogilvie committed Nov 4, 2014
2 parents 56c4a80 + a5c6be9 commit 4f5c7f9
Show file tree
Hide file tree
Showing 130 changed files with 4,073 additions and 2,594 deletions.
10 changes: 6 additions & 4 deletions README.md
Expand Up @@ -12,7 +12,7 @@ The Facebook plugin for [Apache Cordova](http://incubator.apache.org/cordova/) a

## << --- Cordova Registry Warning [iOS]

****Installing this plugin directly from Cordova Registry results in Xcode using a broken `Facebook.framework`, this is because the current publish procedure to NPM breaks symlinks [CB-6092](https://issues.apache.org/jira/browse/CB-6092). Please re-add facebook.framework to Xcode.****
****Installing this plugin directly from Cordova Registry results in Xcode using a broken `FacebookSDK.framework`, this is because the current publish procedure to NPM breaks symlinks [CB-6092](https://issues.apache.org/jira/browse/CB-6092). Please install the plugin through a locally cloned copy or re-add the `FacebookSDK.framework` to Xcode after installation.****

## ------------------------------------------ >>

Expand All @@ -30,6 +30,8 @@ To use this plugin you will need to make sure you've registered your Facebook ap

- [Web App Guide](platforms/web/README.md)

- [PhoneGap Build](platforms/pg-build/README.md)

#### Example Apps

`platforms/android` and `platforms/ios` contain example projects and all the native code for the plugin for both Android and iOS platforms. They also include versions of the Android and iOS Facebook SDKs. These are used during automatic installation.
Expand Down Expand Up @@ -109,7 +111,7 @@ Allows access to the Facebook Graph API. This API allows for additional permissi

Example permissions:

["public_info", "user_birthday"]
["public_profile", "user_birthday"]

Success function returns an Object.

Expand Down Expand Up @@ -159,7 +161,7 @@ In your `onDeviceReady` event add the following
alert("UserInfo: " + JSON.stringify(userData));
}

facebookConnectPlugin.login(["public_info"],
facebookConnectPlugin.login(["public_profile"],
fbLoginSuccess,
function (error) { alert("" + error) }
);
Expand All @@ -177,7 +179,7 @@ If you need the Facebook access token (for example, for validating the login on
});
}

facebookConnectPlugin.login(["public_info"],
facebookConnectPlugin.login(["public_profile"],
fbLoginSuccess,
function (error) { alert("" + error) }
);
Expand Down
2 changes: 1 addition & 1 deletion platforms/android/FacebookLib/AndroidManifest.xml
Expand Up @@ -18,5 +18,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.facebook.android">
<application/>
<uses-sdk android:minSdkVersion="8" />
<uses-sdk android:minSdkVersion="9" />
</manifest>
4 changes: 2 additions & 2 deletions platforms/android/FacebookLib/build.gradle
@@ -1,8 +1,8 @@
apply plugin: 'android-library'

dependencies {
compile 'com.android.support:support-v4:19.1.+'
compile files('../libs/bolts.jar')
compile 'com.android.support:support-v4:20.0.+'
compile 'com.parse.bolts:bolts-android:1.1.2'
}

android {
Expand Down
Binary file not shown.
Binary file removed platforms/android/FacebookLib/libs/bolts.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion platforms/android/FacebookLib/project.properties
Expand Up @@ -12,4 +12,4 @@

android.library=true
# Project target.
target=android-8
target=android-9
14 changes: 6 additions & 8 deletions platforms/android/FacebookLib/src/com/facebook/AccessToken.java
Expand Up @@ -27,11 +27,7 @@
import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.*;

/**
* This class represents an access token returned by the Facebook Login service, along with associated
Expand Down Expand Up @@ -240,9 +236,11 @@ static AccessToken createFromWebBundle(List<String> requestedPermissions, Bundle
static AccessToken createFromRefresh(AccessToken current, Bundle bundle) {
// Only tokens obtained via SSO support refresh. Token refresh returns the expiration date in
// seconds from the epoch rather than seconds from now.
assert (current.source == AccessTokenSource.FACEBOOK_APPLICATION_WEB ||
current.source == AccessTokenSource.FACEBOOK_APPLICATION_NATIVE ||
current.source == AccessTokenSource.FACEBOOK_APPLICATION_SERVICE);
if (current.source != AccessTokenSource.FACEBOOK_APPLICATION_WEB &&
current.source != AccessTokenSource.FACEBOOK_APPLICATION_NATIVE &&
current.source != AccessTokenSource.FACEBOOK_APPLICATION_SERVICE) {
throw new FacebookException("Invalid token source: " + current.source);
}

Date expires = getBundleLongAsDate(bundle, EXPIRES_IN_KEY, new Date(0));
String token = bundle.getString(ACCESS_TOKEN_KEY);
Expand Down
Expand Up @@ -28,6 +28,12 @@ public class AppEventsConstants {
/** Log this event when an app is being activated. */
public static final String EVENT_NAME_ACTIVATED_APP = "fb_mobile_activate_app";

public static final String EVENT_NAME_DEACTIVATED_APP = "fb_mobile_deactivate_app";

public static final String EVENT_NAME_SESSION_INTERRUPTIONS = "fb_mobile_app_interruptions";

public static final String EVENT_NAME_TIME_BETWEEN_SESSIONS = "fb_mobile_time_between_sessions";

/** Log this event when a user has completed registration with the app. */
public static final String EVENT_NAME_COMPLETED_REGISTRATION = "fb_mobile_complete_registration";

Expand Down Expand Up @@ -156,6 +162,10 @@ public class AppEventsConstants {
public static final String EVENT_PARAM_DESCRIPTION = "fb_description";


/**
* Parameter key used to specify source application package
*/
public static final String EVENT_PARAM_SOURCE_APPLICATION = "fb_mobile_launch_source";

// Parameter values

Expand All @@ -164,5 +174,4 @@ public class AppEventsConstants {

/** No-valued parameter value to be used with parameter keys that need a Yes/No value */
public static final String EVENT_PARAM_VALUE_NO = "0";

}

0 comments on commit 4f5c7f9

Please sign in to comment.