Skip to content

Commit 244ce29

Browse files
Tien NguyenTien Nguyen
Tien Nguyen
authored and
Tien Nguyen
committed
remove com.google.zxing
1 parent f153d69 commit 244ce29

File tree

5 files changed

+25
-21
lines changed

5 files changed

+25
-21
lines changed

README.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
# cordova-plugin-facebook4
1+
# cordova-plugin-facebook4-no-zxing2
22

3-
> Use Facebook SDK in Cordova projects
3+
This is a fork from [jeduan/cordova-plugin-facebook4](https://github.com/jeduan/cordova-plugin-facebook4), where i excluded the `com.google.zxing` package (that is used by facebook sdk for qr scaning) that is causing the issue ["Multiple dex files define Lcom/google/zxing/BarcodeFormat"](https://github.com/phonegap/phonegap-plugin-barcodescanner/issues/535)
4+
5+
> Use Facebook SDK version 5.7.0 in Cordova projects
46
57
## Table of contents
68

@@ -18,7 +20,7 @@ See npm package for versions - https://www.npmjs.com/package/cordova-plugin-face
1820
Make sure you've registered your Facebook app with Facebook and have an `APP_ID` [https://developers.facebook.com/apps](https://developers.facebook.com/apps).
1921

2022
```bash
21-
$ cordova plugin add cordova-plugin-facebook4 --save --variable APP_ID="123456789" --variable APP_NAME="myApplication"
23+
$ cordova plugin add cordova-plugin-facebook4-no-zxing2 --save --variable APP_ID="123456789" --variable APP_NAME="myApplication"
2224
```
2325

2426
If you need to change your `APP_ID` after installation, it's recommended that you remove and then re-add the plugin as above. Note that changes to the `APP_ID` value in your `config.xml` file will *not* be propagated to the individual platform builds.
@@ -345,7 +347,7 @@ Starting from Facebook SDK v4.34 for both iOS and Android, there is a new way of
345347

346348
In order to enable this feature in your cordova app, please set the *FACEBOOK_HYBRID_APP_EVENTS* variable to "true"(default is false):
347349
```bash
348-
$ cordova plugin add cordova-plugin-facebook4 --save --variable APP_ID="123456789" --variable APP_NAME="myApplication" --variable FACEBOOK_HYBRID_APP_EVENTS="true"
350+
$ cordova plugin add cordova-plugin-facebook4-no-zxing2 --save --variable APP_ID="123456789" --variable APP_NAME="myApplication" --variable FACEBOOK_HYBRID_APP_EVENTS="true"
349351
```
350352
Please check [this repo](https://github.com/msencer/fb_hybrid_app_events_sample) for an example app using this feature.
351353

build.gradle

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
dependencies {
2+
compile("com.facebook.android:facebook-android-sdk:5.7.0") {
3+
exclude group: 'com.google.zxing'
4+
}
5+
}

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"name": "cordova-plugin-facebook4",
3-
"version": "6.4.0",
2+
"name": "cordova-plugin-facebook4-no-zxing2",
3+
"version": "6.4.1",
44
"description": "Cordova Facebook SDK 4 Plugin",
55
"cordova": {
6-
"id": "cordova-plugin-facebook4",
6+
"id": "cordova-plugin-facebook4-no-zxing2",
77
"platforms": [
88
"android",
99
"ios",
@@ -12,7 +12,7 @@
1212
},
1313
"repository": {
1414
"type": "git",
15-
"url": "https://github.com/jeduan/cordova-plugin-facebook4"
15+
"url": "https://github.com/tien271/cordova-plugin-facebook4-no-zxing2"
1616
},
1717
"keywords": [
1818
"cordova",

plugin.xml

+8-11
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
33
xmlns:android="http://schemas.android.com/apk/res/android"
4-
id="cordova-plugin-facebook4"
4+
id="cordova-plugin-facebook4-no-zxing2"
55
version="6.4.0">
66

77
<name>Facebook Connect</name>
88

99
<description>
10-
This is the official plugin for Facebook in Apache Cordova/PhoneGap!
11-
12-
The Facebook plugin for Apache Cordova allows you to use the same JavaScript code in your
13-
Cordova application as you use in your web application.
10+
This is a fork from jeduan/cordova-plugin-facebook4, where I excluded the com.google.zxing package (that is used by facebook sdk for qr scaning).
1411
</description>
1512

16-
<repo>https://github.com/jeduan/cordova-plugin-facebook4</repo>
13+
<repo>https://github.com/tien271/cordova-plugin-facebook4-no-zxing2</repo>
1714

1815
<license>Apache 2.0</license>
1916

2017
<preference name="APP_ID" />
2118
<preference name="APP_NAME" />
2219
<preference name="FACEBOOK_HYBRID_APP_EVENTS" default="false" />
23-
<preference name="FACEBOOK_ANDROID_SDK_VERSION" default="5.13.0"/>
20+
<preference name="FACEBOOK_ANDROID_SDK_VERSION" default="5.7.0"/>
2421

2522
<engines>
2623
<!-- Requires > 3.5.0 because of the custom Framework tag for iOS [CB-6698] -->
@@ -70,7 +67,7 @@
7067
android:label="@string/fb_app_name" />
7168
</config-file>
7269

73-
<framework src="com.facebook.android:facebook-android-sdk:$FACEBOOK_ANDROID_SDK_VERSION"/>
70+
<framework src="build.gradle" custom="true" type="gradleReference"/>
7471

7572
<!-- cordova plugin src files -->
7673
<source-file src="src/android/ConnectPlugin.java" target-dir="src/org/apache/cordova/facebook" />
@@ -166,9 +163,9 @@
166163
<source url="https://cdn.cocoapods.org/"/>
167164
</config>
168165
<pods use-frameworks="true">
169-
<pod name="FBSDKCoreKit" spec="5.15.0"/>
170-
<pod name="FBSDKLoginKit" spec="5.15.0"/>
171-
<pod name="FBSDKShareKit" spec="5.15.0"/>
166+
<pod name="FBSDKCoreKit" spec="5.7.0"/>
167+
<pod name="FBSDKLoginKit" spec="5.7.0"/>
168+
<pod name="FBSDKShareKit" spec="5.7.0"/>
172169
</pods>
173170
</podspec>
174171

tests/plugin.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
44
xmlns:android="http://schemas.android.com/apk/res/android"
5-
id="cordova-plugin-facebook4-tests"
6-
version="1.0.0">
5+
id="cordova-plugin-facebook4-no-zxing2-tests"
6+
version="6.4.1">
77
<name>Facebook Connect Tests</name>
88
<license></license>
99

0 commit comments

Comments
 (0)