Skip to content

Commit 4f5c7f9

Browse files
author
aogilvie
committed
Merge branch 'master' of github.com:wizcorp/phonegap-facebook-plugin
2 parents 56c4a80 + a5c6be9 commit 4f5c7f9

File tree

130 files changed

+4073
-2594
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+4073
-2594
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The Facebook plugin for [Apache Cordova](http://incubator.apache.org/cordova/) a
1212

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

15-
****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.****
15+
****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.****
1616

1717
## ------------------------------------------ >>
1818

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

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

33+
- [PhoneGap Build](platforms/pg-build/README.md)
34+
3335
#### Example Apps
3436

3537
`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.
@@ -109,7 +111,7 @@ Allows access to the Facebook Graph API. This API allows for additional permissi
109111

110112
Example permissions:
111113

112-
["public_info", "user_birthday"]
114+
["public_profile", "user_birthday"]
113115

114116
Success function returns an Object.
115117

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

162-
facebookConnectPlugin.login(["public_info"],
164+
facebookConnectPlugin.login(["public_profile"],
163165
fbLoginSuccess,
164166
function (error) { alert("" + error) }
165167
);
@@ -177,7 +179,7 @@ If you need the Facebook access token (for example, for validating the login on
177179
});
178180
}
179181

180-
facebookConnectPlugin.login(["public_info"],
182+
facebookConnectPlugin.login(["public_profile"],
181183
fbLoginSuccess,
182184
function (error) { alert("" + error) }
183185
);

platforms/android/FacebookLib/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
1919
package="com.facebook.android">
2020
<application/>
21-
<uses-sdk android:minSdkVersion="8" />
21+
<uses-sdk android:minSdkVersion="9" />
2222
</manifest>

platforms/android/FacebookLib/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apply plugin: 'android-library'
22

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

88
android {
Binary file not shown.
-39.8 KB
Binary file not shown.

platforms/android/FacebookLib/project.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212

1313
android.library=true
1414
# Project target.
15-
target=android-8
15+
target=android-9

platforms/android/FacebookLib/src/com/facebook/AccessToken.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@
2727
import java.io.InvalidObjectException;
2828
import java.io.ObjectInputStream;
2929
import java.io.Serializable;
30-
import java.util.ArrayList;
31-
import java.util.Arrays;
32-
import java.util.Collections;
33-
import java.util.Date;
34-
import java.util.List;
30+
import java.util.*;
3531

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

247245
Date expires = getBundleLongAsDate(bundle, EXPIRES_IN_KEY, new Date(0));
248246
String token = bundle.getString(ACCESS_TOKEN_KEY);

platforms/android/FacebookLib/src/com/facebook/AppEventsConstants.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ public class AppEventsConstants {
2828
/** Log this event when an app is being activated. */
2929
public static final String EVENT_NAME_ACTIVATED_APP = "fb_mobile_activate_app";
3030

31+
public static final String EVENT_NAME_DEACTIVATED_APP = "fb_mobile_deactivate_app";
32+
33+
public static final String EVENT_NAME_SESSION_INTERRUPTIONS = "fb_mobile_app_interruptions";
34+
35+
public static final String EVENT_NAME_TIME_BETWEEN_SESSIONS = "fb_mobile_time_between_sessions";
36+
3137
/** Log this event when a user has completed registration with the app. */
3238
public static final String EVENT_NAME_COMPLETED_REGISTRATION = "fb_mobile_complete_registration";
3339

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

158164

165+
/**
166+
* Parameter key used to specify source application package
167+
*/
168+
public static final String EVENT_PARAM_SOURCE_APPLICATION = "fb_mobile_launch_source";
159169

160170
// Parameter values
161171

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

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

0 commit comments

Comments
 (0)