Skip to content

Commit

Permalink
- Add TOC to README.md
Browse files Browse the repository at this point in the history
- Document dependency on Cocoapods. Resolves #15.
- Make min iOS version configurable. Resolves #14.
  • Loading branch information
dpa99c committed Jun 25, 2019
1 parent 22b513e commit 815f42b
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 10 deletions.
53 changes: 44 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,28 @@ To help ensure this plugin is kept updated, new features are added and bugfixes
<!-- END DONATE -->


<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**

- [Supported Cordova Versions](#supported-cordova-versions)
- [Migrating from cordova-plugin-firebase](#migrating-from-cordova-plugin-firebase)
- [Installation](#installation)
- [Specifying dependent library versions](#specifying-dependent-library-versions)
- [AndroidX](#androidx)
- [iOS minimum version](#ios-minimum-version)
- [Cocoapods](#cocoapods)
- [Guides](#guides)
- [Setup](#setup)
- [IMPORTANT NOTES](#important-notes)
- [PhoneGap Build](#phonegap-build)
- [Google Play Services](#google-play-services)
- [Google Tag Manager](#google-tag-manager)
- [Configuring Notifications](#configuring-notifications)
- [API](#api)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Supported Cordova Versions
- cordova: `>= 8`
- cordova-android: `>= 8`
Expand All @@ -30,7 +52,7 @@ If you already have [cordova-plugin-firebase](https://github.com/arnesson/cordov
## Installation
Install the plugin by adding it to your project's config.xml:
```
<plugin name="cordova-plugin-firebasex" spec="^2.0.7" />
<plugin name="cordova-plugin-firebasex" spec="latest" />
```
or by running:
```
Expand All @@ -45,12 +67,12 @@ By default this plugin pins specific versions of these in [its `plugin.xml`](htt

These defaults can be overridden at plugin installation time by specifying plugin variables as command-line arguments, for example:

cordova plugin add cordova-plugin-firebasex --variable ANDROID_FIREBASE_CORE_VERSION=1.2.3
cordova plugin add cordova-plugin-firebasex --variable ANDROID_FIREBASE_CORE_VERSION=17.0.0

Or you can specify them as plugin variables in your `config.xml`, for example:

<plugin name="cordova-plugin-firebasex" spec="^2.0.7">
<variable name="ANDROID_FIREBASE_CORE_VERSION" value="1.2.3" />
<plugin name="cordova-plugin-firebasex" spec="latest">
<variable name="ANDROID_FIREBASE_CORE_VERSION" value="17.0.0" />
</plugin>

The following plugin variables are use to specify the follow Gradle dependency versions on Android:
Expand Down Expand Up @@ -93,7 +115,7 @@ For example, to explicitly specify all the component versions at plugin install
--variable IOS_FABRIC_VERSION=1.9.0 \
--variable IOS_CRASHLYTICS_VERSION=3.12.0

## AndroidX
### AndroidX
This plugin has been migrated to use [AndroidX (Jetpack)](https://developer.android.com/jetpack/androidx/migrate) which is the successor to the [Android Support Library](https://developer.android.com/topic/libraries/support-library/index).
This is implemented by adding a dependency on [cordova-plugin-androidx](https://github.com/dpa99c/cordova-plugin-androidx) which enables AndroidX in the Android platform of a Cordova project.

Expand All @@ -102,10 +124,22 @@ This is because the [major release of the Firebase and Play Services libraries o
Therefore if your project includes any plugins which are dependent on the legacy Android Support Library, you should add [cordova-plugin-androidx-adapter](https://github.com/dpa99c/cordova-plugin-androidx-adapter) to your project.
This plugin will dynamically migrate any plugin code from the Android Support Library to AndroidX equivalents.

### Guides
### iOS minimum version
This plugin sets a default minimum iOS version in the Pod file (see `<preference name="IOS_MIN_VERSION">` in `plugin.xml`) which can be overriden using a plugin variable of the same name, e.g.:

cordova plugin add cordova-plugin-firebasex --variable IOS_MIN_VERSION=10.0

### Cocoapods
This plugin depends on [cordova-plugin-cocoapod-supportx](https://github.com/dpa99c/cordova-plugin-cocoapods-support) which adds Cordova support for the [CocoaPods dependency manager]( https://cocoapods.org/) in order to satify the iOS Firebase SDK library dependencies.

Therefore please make sure you have Cocopods installed in your iOS build environemnt - setup instructions can be found [here](https://cocoapods.org/).
Also make sure your local Cocoapods repo is up-to-date by running `pod repo update`.


## Guides
Great installation and setup guide by Medium.com - [https://medium.com/@felipepucinelli/how-to-add-push...](https://medium.com/@felipepucinelli/how-to-add-push-notifications-in-your-cordova-application-using-firebase-69fac067e821)

### Setup
## Setup
Download your Firebase configuration files, GoogleService-Info.plist for iOS and google-services.json for android, and place them in the root folder of your cordova project. Check out this [firebase article](https://support.google.com/firebase/answer/7015592) for details on how to download the files.

```
Expand All @@ -119,7 +153,7 @@ Download your Firebase configuration files, GoogleService-Info.plist for iOS and
...
```

###### IMPORTANT NOTES
## IMPORTANT NOTES
- This plugin uses a hook (after prepare) that copies the configuration files to the right place, namely `platforms/ios/\<My Project\>/Resources` for ios and `platforms/android` for android.
- Firebase SDK requires the configuration files to be present and valid, otherwise your app will crash on boot or Firebase features won't work.

Expand All @@ -131,7 +165,7 @@ Your build may fail if you are installing multiple plugins that use Google Play

If your build is still failing, you can try installing [cordova-android-firebase-gradle-release](https://github.com/dpa99c/cordova-android-firebase-gradle-release). For more info, read the following [comment](https://github.com/dpa99c/cordova-plugin-request-location-accuracy/issues/50#issuecomment-390025013) about locking down the specific versions for play services and firebase.

## Google Tag Manager
### Google Tag Manager

Checkout our [guide](docs/GOOGLE_TAG_MANAGER.md) for info on setting up Google Tag Manager.

Expand All @@ -142,3 +176,4 @@ Checkout our [guide](docs/NOTIFICATIONS.md) for info on configuring notification
## API

See the full [API](docs/API.md) available for this plugin.

3 changes: 2 additions & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@
<source-file src="src/ios/FirebasePlugin.m" />


<pods-config ios-min-version="9.0" use-frameworks="true"/>
<preference name="IOS_MIN_VERSION" default="9.0" />
<pods-config ios-min-version="$IOS_MIN_VERSION" use-frameworks="true"/>

<preference name="IOS_FIREBASE_CORE_VERSION" default="5.20.2" />
<preference name="IOS_FIREBASE_AUTH_VERSION" default="5.20.2" />
Expand Down

0 comments on commit 815f42b

Please sign in to comment.