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

Commit

Permalink
Upgrade to latest Firebase SDK's #215
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyVerbruggen committed Nov 18, 2016
1 parent d6e359c commit 1fd09d1
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 24 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
<img src="docs/images/firebase-logo.png" width="116px" height="32px" alt="Firebase"/>


## 3.8.0 (2016, November 18) ******** UNRELEASED

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

### SDK versions

If version numbers __changed__, clean your platform folders to avoid build errors.
Also, for Android update your Google Repository in the Android SDK manager (type `android` on the command prompt),
and for iOS do a `pod repo update` to fetch the latest versions from Cocoapods.

- iOS: 3.9.x
- Android: 9.8.x

TODO



## 3.7.2 (2016, November 8)

[Full changelog](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/compare/3.7.1...3.7.2)
Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ If you see an error like `Unable to satisfy the following requirements: Firebase
then check [issue 98](#98) which perfectly explains how to update your local Pod spec repo, or first try
to `tns platform remove ios && tns platform add ios`.

Running `pod repo update` on the command line will make sure you have the latest Podspec,
so when the plugin updates and a newer Firebase version can't be found, try that first.

## Known issues on Android

#### Genymotion
Expand Down Expand Up @@ -205,7 +208,7 @@ the changes to `build.gradle` which are mentioned above as well.

#### Could not find com.google...
And there's this one: "Could not find com.google.firebase:firebase-auth:9.4.0". That means
making sure you have the latest Google Repository bits installed.
making sure you have the latest `Google Repository` bits installed.
Just run `android` from a command prompt and install any pending updates.

Also, an error like "Could not find com.google.firebase:firebase-core:9.0.0" can be caused by having
Expand All @@ -215,5 +218,9 @@ that is being updated otherwise it will seem as though your updates have no effe
#### Found play-services:9.0.0, but version 9.0.2 is needed..
Update your Android bits like the issue above and reinstall the android platform in your project.

#### EEXIST: file already exists, symlink '../mkdirp/bin/cmd.js
This is a reace condition in a tool deep down the toolchain, so not the fault of this plugin.
Just rerun the build, it only pops up sometimes.

## Credits
The starting point for this plugin was [this great Gist](https://gist.github.com/jbristowe/c89a7bcae7fc9a035ee7) by [John Bristowe](https://github.com/jbristowe).
18 changes: 9 additions & 9 deletions platforms/android/include.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,29 @@ repositories {

dependencies {
// make sure you have these versions by updating your local Android SDK's (Android Support repo and Google repo)
compile "com.google.firebase:firebase-core:9.6.+"
compile "com.google.firebase:firebase-database:9.6.+"
compile "com.google.firebase:firebase-auth:9.6.+"
compile "com.google.firebase:firebase-crash:9.6.+"
compile "com.google.firebase:firebase-core:9.8.+"
compile "com.google.firebase:firebase-database:9.8.+"
compile "com.google.firebase:firebase-auth:9.8.+"
compile "com.google.firebase:firebase-crash:9.8.+"

// for reading google-services.json and configuration
def googlePlayServicesVersion = project.hasProperty('googlePlayServicesVersion') ? project.googlePlayServicesVersion : '9.6.+'
def googlePlayServicesVersion = project.hasProperty('googlePlayServicesVersion') ? project.googlePlayServicesVersion : '9.8.+'
compile "com.google.android.gms:play-services-base:$googlePlayServicesVersion"

// Uncomment if you want to use 'Remote Config'
// compile "com.google.firebase:firebase-config:9.6.+"
// compile "com.google.firebase:firebase-config:9.8.+"

// Uncomment if you want FCM (Firebase Cloud Messaging)
// compile "com.google.firebase:firebase-messaging:9.6.+"
// compile "com.google.firebase:firebase-messaging:9.8.+"

// Uncomment if you want Google Cloud Storage
// compile 'com.google.firebase:firebase-storage:9.6.+'
// compile 'com.google.firebase:firebase-storage:9.8.+'

// Uncomment if you need Facebook Authentication
// compile "com.facebook.android:facebook-android-sdk:4.+"

// Uncomment if you need Google Sign-In Authentication
// compile "com.google.android.gms:play-services-auth:9.6.+"
// compile "com.google.android.gms:play-services-auth:9.8.+"

}

Expand Down
4 changes: 2 additions & 2 deletions platforms/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

pod 'Firebase', '~> 3.7.0'
pod 'Firebase', '~> 3.9.0'
pod 'Firebase/Database'
pod 'Firebase/Auth'
#pod 'Firebase/Crash'
pod 'Firebase/Crash'

# Uncomment if you want to enable Remote Config
#pod 'Firebase/RemoteConfig'
Expand Down
24 changes: 12 additions & 12 deletions scripts/postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ function writePodFile(result) {
}
try {
fs.writeFileSync(directories.ios + '/Podfile',
`pod 'Firebase', '~> 3.7.0'
`pod 'Firebase', '~> 3.9.0'
pod 'Firebase/Database'
pod 'Firebase/Auth'
#pod 'Firebase/Crash'
pod 'Firebase/Crash'
# Uncomment if you want to enable Remote Config
` + (isSelected(result.remote_config) ? `` : `#`) + `pod 'Firebase/RemoteConfig'
Expand Down Expand Up @@ -221,29 +221,29 @@ repositories {
dependencies {
// make sure you have these versions by updating your local Android SDK's (Android Support repo and Google repo)
compile "com.google.firebase:firebase-core:9.6.+"
compile "com.google.firebase:firebase-database:9.6.+"
compile "com.google.firebase:firebase-auth:9.6.+"
compile "com.google.firebase:firebase-crash:9.6.+"
compile "com.google.firebase:firebase-core:9.8.+"
compile "com.google.firebase:firebase-database:9.8.+"
compile "com.google.firebase:firebase-auth:9.8.+"
compile "com.google.firebase:firebase-crash:9.8.+"
// for reading google-services.json and configuration
def googlePlayServicesVersion = project.hasProperty('googlePlayServicesVersion') ? project.googlePlayServicesVersion : '9.6.+'
def googlePlayServicesVersion = project.hasProperty('googlePlayServicesVersion') ? project.googlePlayServicesVersion : '9.8.+'
compile "com.google.android.gms:play-services-base:$googlePlayServicesVersion"
// Uncomment if you want to use 'Remote Config'
` + (isSelected(result.remote_config) ? `` : `//`) + ` compile "com.google.firebase:firebase-config:9.6.+"
` + (isSelected(result.remote_config) ? `` : `//`) + ` compile "com.google.firebase:firebase-config:9.8.+"
// Uncomment if you want FCM (Firebase Cloud Messaging)
` + (isSelected(result.messaging) ? `` : `//`) + ` compile "com.google.firebase:firebase-messaging:9.6.+"
` + (isSelected(result.messaging) ? `` : `//`) + ` compile "com.google.firebase:firebase-messaging:9.8.+"
// Uncomment if you want Google Cloud Storage
` + (isSelected(result.storage) ? `` : `//`) + ` compile 'com.google.firebase:firebase-storage:9.6.+'
` + (isSelected(result.storage) ? `` : `//`) + ` compile 'com.google.firebase:firebase-storage:9.8.+'
// Uncomment if you need Facebook Authentication
` + (isSelected(result.facebook_auth) ? `` : `//`) + ` compile "com.facebook.android:facebook-android-sdk:4.+"
// Uncomment if you need Google Sign-In Authentication
` + (isSelected(result.google_auth) ? `` : `//`) + ` compile "com.google.android.gms:play-services-auth:9.6.+"
` + (isSelected(result.google_auth) ? `` : `//`) + ` compile "com.google.android.gms:play-services-auth:9.8.+"
}
Expand Down Expand Up @@ -275,7 +275,7 @@ module.exports = function() {
console.log("Copy " + sourceGoogleJson + " to " + destinationGoogleJson + ".");
fs.writeFileSync(destinationGoogleJson, fs.readFileSync(sourceGoogleJson));
}
}
};
`;
var scriptPath = path.join(appRoot, "hooks", "after-prepare", "firebase-copy-google-services.js");
var afterPrepareDirPath = path.dirname(scriptPath);
Expand Down

0 comments on commit 1fd09d1

Please sign in to comment.