Skip to content

Commit

Permalink
remove com.google.zxing
Browse files Browse the repository at this point in the history
  • Loading branch information
Tien Nguyen authored and Tien Nguyen committed Jun 15, 2020
1 parent f153d69 commit 244ce29
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 21 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# cordova-plugin-facebook4
# cordova-plugin-facebook4-no-zxing2

> Use Facebook SDK in Cordova projects
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)

> Use Facebook SDK version 5.7.0 in Cordova projects
## Table of contents

Expand All @@ -18,7 +20,7 @@ See npm package for versions - https://www.npmjs.com/package/cordova-plugin-face
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).

```bash
$ cordova plugin add cordova-plugin-facebook4 --save --variable APP_ID="123456789" --variable APP_NAME="myApplication"
$ cordova plugin add cordova-plugin-facebook4-no-zxing2 --save --variable APP_ID="123456789" --variable APP_NAME="myApplication"
```

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.
Expand Down Expand Up @@ -345,7 +347,7 @@ Starting from Facebook SDK v4.34 for both iOS and Android, there is a new way of

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

Expand Down
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dependencies {
compile("com.facebook.android:facebook-android-sdk:5.7.0") {
exclude group: 'com.google.zxing'
}
}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "cordova-plugin-facebook4",
"version": "6.4.0",
"name": "cordova-plugin-facebook4-no-zxing2",
"version": "6.4.1",
"description": "Cordova Facebook SDK 4 Plugin",
"cordova": {
"id": "cordova-plugin-facebook4",
"id": "cordova-plugin-facebook4-no-zxing2",
"platforms": [
"android",
"ios",
Expand All @@ -12,7 +12,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/jeduan/cordova-plugin-facebook4"
"url": "https://github.com/tien271/cordova-plugin-facebook4-no-zxing2"
},
"keywords": [
"cordova",
Expand Down
19 changes: 8 additions & 11 deletions plugin.xml
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="cordova-plugin-facebook4"
id="cordova-plugin-facebook4-no-zxing2"
version="6.4.0">

<name>Facebook Connect</name>

<description>
This is the official plugin for Facebook in Apache Cordova/PhoneGap!

The Facebook plugin for Apache Cordova allows you to use the same JavaScript code in your
Cordova application as you use in your web application.
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).
</description>

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

<license>Apache 2.0</license>

<preference name="APP_ID" />
<preference name="APP_NAME" />
<preference name="FACEBOOK_HYBRID_APP_EVENTS" default="false" />
<preference name="FACEBOOK_ANDROID_SDK_VERSION" default="5.13.0"/>
<preference name="FACEBOOK_ANDROID_SDK_VERSION" default="5.7.0"/>

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

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

<!-- cordova plugin src files -->
<source-file src="src/android/ConnectPlugin.java" target-dir="src/org/apache/cordova/facebook" />
Expand Down Expand Up @@ -166,9 +163,9 @@
<source url="https://cdn.cocoapods.org/"/>
</config>
<pods use-frameworks="true">
<pod name="FBSDKCoreKit" spec="5.15.0"/>
<pod name="FBSDKLoginKit" spec="5.15.0"/>
<pod name="FBSDKShareKit" spec="5.15.0"/>
<pod name="FBSDKCoreKit" spec="5.7.0"/>
<pod name="FBSDKLoginKit" spec="5.7.0"/>
<pod name="FBSDKShareKit" spec="5.7.0"/>
</pods>
</podspec>

Expand Down
4 changes: 2 additions & 2 deletions tests/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

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

Expand Down

0 comments on commit 244ce29

Please sign in to comment.