Skip to content

Commit

Permalink
Support for cordova-android v7 without workaround (jeduan#716)
Browse files Browse the repository at this point in the history
  • Loading branch information
adipascu authored and peterpeterparker committed Dec 15, 2018
1 parent bc9da0c commit 87368d1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The Facebook plugin for [Apache Cordova](http://cordova.apache.org/) allows you
## Compatibility

* Cordova >= 5.0.0
* cordova-android >= 4.0 (see Android Guide for cordova-android >= 7)
* cordova-android >= 4.0
* cordova-ios >= 3.8
* cordova-browser >= 3.6
* Phonegap build (use phonegap-version >= cli-5.2.0, android-minSdkVersion>=15, and android-build-tool=gradle), see [example here](https://github.com/yoav-zibin/phonegap-tictactoe/blob/gh-pages/www/config.xml)
Expand Down
9 changes: 0 additions & 9 deletions docs/android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@ You could add the property manually or specify it when you install the plugin, s

Of course if you could, you could update your Cordova CLI and avoid specifying explicitly this option

### cordova-android >= 7

In order to install correctly this plugin for `cordova-android` v7.x.y and above, you have to specify the APP_ID and APP_NAME in the android `platform` tag of your `config.xml`

<config-file parent="/resources" target="./res/values/strings.xml">
<string name="fb_app_id">123456789</string>
<string name="fb_app_name">myApplication</string>
</config-file>

### In case of conflict

If you would face version conflicts regarding the Facebook SDK with other plugins used in your project while installing `cordova-plugin-facebook4` for your ANDROID platform, you would be able to specify a specific Facebook SDK version for ANDROID using the variable `FACEBOOK_ANDROID_SDK_VERSION`
Expand Down
6 changes: 6 additions & 0 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,16 @@
</config-file>

<source-file src="src/android/facebookconnect.xml" target-dir="res/values" />
<!-- Used for cordova-android 6 -->
<config-file target="res/values/facebookconnect.xml" parent="/*">
<string name="fb_app_id">$APP_ID</string>
<string name="fb_app_name">$APP_NAME</string>
</config-file>
<!-- Used for cordova-android 7 -->
<config-file target="app/src/main/res/values/facebookconnect.xml" parent="/*">
<string name="fb_app_id">$APP_ID</string>
<string name="fb_app_name">$APP_NAME</string>
</config-file>

<config-file target="AndroidManifest.xml" parent="application">
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/fb_app_id"/>
Expand Down

0 comments on commit 87368d1

Please sign in to comment.