Skip to content
This repository has been archived by the owner on Oct 24, 2022. It is now read-only.

Add workaround for using setting strings in cordova-android 7.x #716

Merged
merged 1 commit into from
Dec 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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