Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
#101 Post Install Concept
Browse files Browse the repository at this point in the history
- trivial cleanup
- doc adjustments
- version bump
  • Loading branch information
EddyVerbruggen committed Aug 12, 2016
1 parent 277f7b8 commit d632074
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 33 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
<img src="docs/images/firebase-logo.png" width="116px" height="32px" alt="Firebase"/>

## 3.5.1 (2016, August 12)

[Full changelog](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/compare/3.5.0...3.5.1)

### SDK versions
If version numbers changed clean your platform folders to avoid build errors.

- iOS: 3.3.x
- Android: 9.4.0

### New
- [#101](#101) Post Install script, to help making configuration easier!



## 3.5.0 (2016, August 9)

[Full changelog](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/compare/3.4.4...3.5.0)
Expand Down
28 changes: 13 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ For readability the supported features have been moved to their own README's:
* [Storage](docs/STORAGE.md)
* [Crash Reporting](docs/CRASHREPORTING.md)

## NativeScript version
Please update to at least tns 2.1.0 to make plugin installation a little easier (otherwise you'll need to manually add an `applicationId` to `app/App_Resources/Android/app.gradle`).

## Prerequisites
Head on over to [https://console.firebase.google.com/](https://console.firebase.google.com/) and sign up for a free account.
Your first 'Firebase' will be automatically created and made available via an URL like `https://n-plugin-test.firebaseio.com`.
Expand All @@ -35,8 +38,10 @@ From the command prompt go to your app's root folder and execute:
```
tns plugin add nativescript-plugin-firebase
```
_This will guide you through installing additional components. Check the doc links above to see what's what. You can always change your choices later._


And do yourself a favor by adding TypeScript support to your nativeScript app:
Do yourself a favor by adding TypeScript support to your nativeScript app:

```
tns install typescript
Expand All @@ -51,28 +56,21 @@ Then open `references.d.ts` in the root of your project and add this line to get
### Android
Install packages 'Google Play Services' and 'Google Repository' in your [Android SDK Manager](http://stackoverflow.com/a/37310513)

#### Open `app/App_Resources/Android/app.gradle`
- If there's no `applicationId` yet please add it to the `defaultConfig` node so it becomes:

```
android {
...
defaultConfig {
applicationId = "your.package.name"
...
}
}
```

#### Open `platforms/android/build.gradle`
We're trying to automate these steps, but for now:

- Near the top there's a dependencies section, add `classpath "com.google.gms:google-services:3.0.0"` so it becomes something like:
```
dependencies {
classpath "com.android.tools.build:gradle:1.5.0"
classpath "com.google.gms:google-services:3.0.0"
}
```
- Add the very bottom of the same file add `apply plugin: "com.google.gms.google-services"`

- Add the very bottom of the same file add
```
apply plugin: "com.google.gms.google-services"
```

## Usage

Expand Down
10 changes: 5 additions & 5 deletions docs/AUTHENTICATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ Use this login type to authenticate against firebase using a token generated by

### Facebook login

First, enable Facebook login in your firebase instance and add the App-ID and App-Secret.
First, enable Facebook login in your Firebase instance and add the App-ID and App-Secret.

Then add the following lines to your code and check for setup instructions for your platform below.

Expand All @@ -203,11 +203,11 @@ Then add the following lines to your code and check for setup instructions for y
For a complete list of the available scope permissions, visit Facebook's documentation: https://developers.facebook.com/docs/facebook-login/permissions.

#### iOS
If you want to use it for iOS open the `Podfile` in the plugin's `platforms/ios` folder and uncomment the Facebook line (you can't miss it).
If you didn't choose this feature during installation you can open the `Podfile` in the plugin's `platforms/ios` folder and uncomment the Facebook line.

#### Android

1. Uncomment the facebook SDK in `node_modules\nativescript-plugin-firebase\platforms\android\include.gradle`
1. If you didn't choose this feature during installation you can uncomment the facebook SDK in `node_modules\nativescript-plugin-firebase\platforms\android\include.gradle`
2. Add `<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>` to the `manifest/application tag` in `app\App_Resources\Android\AndroidManifest.xml`, so it becomes similar to this:

```xml
Expand Down Expand Up @@ -252,7 +252,7 @@ Then add the following lines to your code and check for setup instructions for y
```

#### iOS
If you want to use it for iOS open the `Podfile` in the plugin's `platforms/ios` folder and uncomment the `GoogleSignIn` line.
If you didn't choose this feature during installation you can open the `Podfile` in the plugin's `platforms/ios` folder and uncomment the `GoogleSignIn` line.

Make sure the URL Scheme for `REVERSED_CLIENT_ID` is in `app/App_Resources/iOS/Info.plist`:

Expand All @@ -274,7 +274,7 @@ Then add the following lines to your code and check for setup instructions for y

#### Android

1. Uncomment `google-services-auth` in `node_modules\nativescript-plugin-firebase\platforms\android\include.gradle`
1. If you didn't choose this feature during installation you can uncomment `google-services-auth` in `node_modules\nativescript-plugin-firebase\platforms\android\include.gradle`
2. Google Sign-In requires an SHA1 fingerprint: see [Authenticating Your Client for details](https://developers.google.com/android/guides/client-auth). If you don't do this you will see the account selection popup, but you won't be able to actually sign in.

### logout
Expand Down
4 changes: 2 additions & 2 deletions docs/MESSAGING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Version 3.3.0 of this plugin added FCM support (which is the successor of GCM).
Although using push messages in your Firebase app is really easy setting it up is not. Traditionally, especially for iOS.

### Android
Uncomment `firebase-messaging` in [include.gradle](../platforms/android/include.gradle)
If you didn't choose this feature during installation you can uncomment `firebase-messaging` in [include.gradle](../platforms/android/include.gradle)

### iOS
Uncomment `Firebase/Messaging` in [Podfile](../platforms/ios/Podfile)
If you didn't choose this feature during installation you can uncomment `Firebase/Messaging` in [Podfile](../platforms/ios/Podfile)

#### Receiving remote notifications in the background
Open `app/App_Resources/iOS/Info.plist` and add this to the bottom:
Expand Down
5 changes: 2 additions & 3 deletions docs/REMOTECONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ This feature lets you configure parameters in your Firebase instance like these:

<img src="images/remote-config.png" width="500px" height="482px" alt="Remote Config"/>

To enable support for Remote Config you need to manually adjust
If you didn't choose this feature during installation you can manually uncomment
the relevant lines to add the SDK's to your app in
[Podfile](../platforms/ios/Podfile) and [include.gradle](../platforms/android/include.gradle).

Just uncomment the relevant lines (one for each platform) to add the SDK's to your app.

## Functions

### getRemoteConfig
Expand Down
3 changes: 2 additions & 1 deletion docs/STORAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Since plugin version 3.4.0 you can use Firebase _Storage_ features.

_Storage_ lets you upload and download files to/from Google Cloud Storage which is connected to your Firebase instance.

To enable support for Remote Config you need to manually adjust
If you didn't choose this feature during installation you can manually uncomment
the relevant lines to add the SDK's to your app in
[Podfile](../platforms/ios/Podfile) and [include.gradle](../platforms/android/include.gradle).

Just uncomment the relevant lines (one for each platform) to add the SDK's to your app.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nativescript-plugin-firebase",
"version": "3.5.0",
"version": "3.5.1",
"description" : "Fire. Base. Firebase!",
"main" : "firebase.js",
"nativescript": {
Expand Down
12 changes: 6 additions & 6 deletions scripts/postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var usingiOS = false, usingAndroid = false;
var directories = {
ios: './platforms/ios',
android: './platforms/android'
}
};

console.log('NativeScript Firebase Plugin Installation');
prompt.start();
Expand All @@ -21,7 +21,7 @@ function askiOSPrompt() {
prompt.get({
name: 'using_ios',
description: 'Are you using iOS (y/n)',
default: 'y',
default: 'y'
}, function (err, result) {
if (err) {
return console.log(err);
Expand All @@ -40,7 +40,7 @@ function askAndroidPrompt() {
prompt.get({
name: 'using_android',
description: 'Are you using Android (y/n)',
default: 'y',
default: 'y'
}, function (err, result) {
if (err) {
return console.log(err);
Expand All @@ -55,13 +55,13 @@ function askAndroidPrompt() {
}

/**
* Prompt the user through the configurable firebase add-on services
* Prompt the user through the configurable Firebase add-on services
*/
function promptQuestions() {
prompt.get([{
name: 'remote_config',
description: 'Are you using Firebase RemoteConfig (y/n)',
default: 'n',
default: 'n'
}, {
name: 'messaging',
description: 'Are you using Firebase Messaging (y/n)',
Expand Down Expand Up @@ -191,7 +191,7 @@ function writeGradleFile(result) {
* Determines if the answer validates as selected
*
* @param {any} value The user input for a prompt
* @returns {true} The answer is yes, {false} The answer is no
* @returns {boolean} The answer is yes, {false} The answer is no
*/
function isSelected(value) {
return (value && value.toLowerCase() === 'y')
Expand Down

0 comments on commit d632074

Please sign in to comment.