You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 4, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,8 @@ Open your Firebase project at the Google console and click 'Add app' to add an i
37
37
38
38
* Android: `google-services.json` which you'll add to your NativeScript project at `app/App_Resources/Android/google-services.json`
39
39
40
+
Note: for using separate versions of these files for dev/prod environments see [this section](#separation-of-environments)
41
+
40
42
## Installation
41
43
If you rather watch a (slightly outdated) video explaining the steps then check out this step-by-step guide - you'll also learn how to
42
44
add iOS and Android support to the Firebase console and how to integrate anonymous authentication:
@@ -268,3 +270,28 @@ android {
268
270
```
269
271
270
272
Where `"15.0.0"` is best set to the same value as the `googlePlayServicesVersion` value in [this file](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/blob/48a99ccd2a0f590c37080b1a252173ea9b996e9f/publish/scripts/installer.js#L540).
273
+
274
+
## Separation of Environments
275
+
276
+
It is possible to use different development and production environments by using multiple `GoogleService-Info.plist` and `google-services.json` files.
277
+
278
+
### Setup
279
+
1. Create two separate Firebase projects (e.g. `myproject` and `myproject-dev`) and configure them with the same package name
280
+
2. Download the `plist` and `json` files for both projects and put them in the relevant directories with either `.dev` or `.prod` appended to the file names, so you have the following files in place:
Note: if you currently have the `storageBucket` property in the `firebase.init()` then remove it (not mandatory anymore as of version `6.5.0` of this plugin), so it will be taken automatically from the relevant google services `plist` and `json` files.
290
+
291
+
### Build
292
+
The after-prepare hook of this plugin will now choose either the `dev` or the `prod` version of your google services `plist` and `json` files depending on how you run your build:
293
+
294
+
*`prod` will be selected if you run with either the `--release`, `--env.prod` or `--env.production` flags
295
+
*`dev` will be selected if you do not run with the above flags
296
+
297
+
Note: if you do not have both `dev` and `prod` files in place, the regular `GoogleService-Info.plist` and `google-services.json` files will be used.
} else if (!fs.existsSync(sourceGooglePlist)) { // single GoogleService-Info.plist modus but missing
3615
+
copyPlistOpts.$logger.warn("nativescript-plugin-firebase: " + sourceGooglePlist + " does not exist. Please follow the installation instructions from the documentation");
3616
+
return false;
3617
+
} else {
3618
+
return true; // single GoogleService-Info.plist modus
0 commit comments