Skip to content

Commit

Permalink
Upgrade Firebase SDK's
Browse files Browse the repository at this point in the history
  • Loading branch information
vash15 committed Nov 11, 2020
1 parent 43fa8ec commit db655c5
Show file tree
Hide file tree
Showing 7 changed files with 270 additions and 202 deletions.
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"url": "https://github.com/arnesson/cordova-plugin-firebase"
},
"name": "cordova-plugin-firebase",
"version": "2.1.0",
"version": "3.0.0",
"description": "Cordova plugin for Google Firebase",
"cordova": {
"id": "cordova-plugin-firebase",
Expand Down Expand Up @@ -39,5 +39,9 @@
"test:[email protected]:[email protected]": "bash ./test/test-default.sh 8.1.2 android 7.1.4 && bash ./test/test-with-3-plugins.sh 8.1.2 android 7.1.4 cordova-plugin-request-location-accuracy cordova-android-play-services-gradle-release cordova-android-firebase-gradle-release",
"test:[email protected]:[email protected]": "bash ./test/test-default.sh 8.1.2 browser 5.0.3"
},
"dependencies": {}
"dependencies": {
"xcode": "^2.0.0",
"xml2js": "^0.4.19",
"plugman": "^2.0.0"
}
}
28 changes: 15 additions & 13 deletions plugin.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<plugin id="cordova-plugin-firebase" version="2.1.0"
<plugin id="cordova-plugin-firebase" version="3.0.0"
xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android">
<name>Google Firebase Plugin</name>
Expand Down Expand Up @@ -50,20 +50,22 @@ xmlns:android="http://schemas.android.com/apk/res/android">
<source-file src="src/android/colors.xml" target-dir="res/values" />

<dependency-classpath name="com.android.tools.build:gradle:3.4.1" />
<dependency-classpath name="com.google.gms:google-services:4.2.0" />
<dependency-classpath name="io.fabric.tools:gradle:1.29.0" />
<dependency-classpath name="com.google.firebase:perf-plugin:1.2.1" />
<dependency-classpath name="com.google.gms:google-services:4.3.4" />
<dependency-classpath name="com.google.firebase:firebase-crashlytics-gradle:2.3.0" />
<dependency-classpath name="com.google.firebase:perf-plugin:1.3.3" />

<framework-implementation name="com.google.android.gms:play-services-analytics-impl:16.0.7" />
<framework-implementation name="com.google.android.gms:play-services-analytics-impl:16.0.8" />
<framework-implementation name="com.google.android.gms:play-services-measurement-base@[16.0.4]" />
<framework-implementation name="com.google.firebase:firebase-core:16.0.9" />
<framework-implementation name="com.google.firebase:firebase-auth:17.0.0" />
<framework-implementation name="com.google.firebase:firebase-messaging:18.0.0" />
<framework-implementation name="com.google.firebase:firebase-config:17.0.0" />
<framework-implementation name="com.google.firebase:firebase-perf:17.0.0" />
<framework-implementation name="com.google.firebase:firebase-dynamic-links:17.0.0" />
<framework-implementation name="com.google.android.gms:play-services-tagmanager:16.0.8" />
<framework-implementation name="com.crashlytics.sdk.android:crashlytics:2.10.0" />

<framework-implementation name="com.google.firebase:firebase-bom:26.0.0" />

<framework-implementation name="com.google.firebase:firebase-crashlytics" />
<framework-implementation name="com.google.firebase:firebase-analytics" />
<framework-implementation name="com.google.firebase:firebase-config" />
<framework-implementation name="com.google.firebase:firebase-perf" />
<framework-implementation name="com.google.firebase:firebase-dynamic-links" />
<framework-implementation name="com.google.firebase:firebase-auth" />
<framework-implementation name="com.google.firebase:firebase-messaging" />

</platform>

Expand Down
21 changes: 13 additions & 8 deletions scripts/android/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ function addRepos(buildGradle) {
// modify the line to add the necessary repo
// Crashlytics goes under buildscripts which is the first grouping in the file

if ( buildGradle.indexOf('Fabrics Maven repository from cordova-plugin-firebase') == -1 ){
var fabricMavenRepo = whitespace + 'maven { url \'https://maven.fabric.io/public\' } // Fabrics Maven repository from cordova-plugin-firebase'
var modifiedLine = fabricMavenRepo + '\n' + match[0];
// modify the actual line
buildGradle = buildGradle.replace(/^(\s*)jcenter\(\)/m, modifiedLine);
}
// if ( buildGradle.indexOf('Fabrics Maven repository from cordova-plugin-firebase') == -1 ){
// var fabricMavenRepo = whitespace + 'maven { url \'https://maven.fabric.io/public\' } // Fabrics Maven repository from cordova-plugin-firebase'
// var modifiedLine = fabricMavenRepo + '\n' + match[0];
// // modify the actual line
// buildGradle = buildGradle.replace(/^(\s*)jcenter\(\)/m, modifiedLine);
// }

if ( buildGradle.indexOf('Google\'s Maven repository from cordova-plugin-firebase') > -1 )
return buildGradle;
Expand Down Expand Up @@ -111,7 +111,12 @@ function addFrameworks(buildGradle, useFrameworks){
+'\n'+whitespace+'implementation \'me.leolin:ShortcutBadger:1.1.4@aar\'';

useFrameworks.forEach(function(framework){
lines += '\n'+whitespace+'implementation \''+ framework +'\'';
if ( framework.indexOf('com.google.firebase:firebase-bom') > -1 ){
lines += '\n'+whitespace+'implementation platform(\''+ framework +'\')';
}else{
lines += '\n'+whitespace+'implementation \''+ framework +'\'';
}

});

lines += '\n'+whitespace+'\/\/ FIREBASE FRAMEWORKS END';
Expand Down Expand Up @@ -229,7 +234,7 @@ module.exports = {
var firebasePlugins =
'apply plugin: \'com.android.application\'\n'+
'apply plugin: \'com.google.gms.google-services\' // from cordova-plugin-firebase\n'+
'apply plugin: \'io.fabric\' // from cordova-plugin-firebase\n'+
'apply plugin: \'com.google.firebase.crashlytics\' // from cordova-plugin-firebase\n'+
'apply plugin: \'com.google.firebase.firebase-perf\' // from cordova-plugin-firebase\n';

buildGradle = buildGradle.replace(/apply plugin: \'com.android.application\'\n/m, firebasePlugins);
Expand Down
3 changes: 1 addition & 2 deletions scripts/ios/helper.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var fs = require("fs");
var path = require("path");
var utilities = require("../lib/utilities");
var xcode = require("xcode");

/**
* This is used as the display text for the build phase block in XCode as well as the
Expand Down Expand Up @@ -30,7 +31,6 @@ module.exports = {
* (dSYMs) so that Crashlytics can display stack trace information in it's web console.
*/
addShellScriptBuildPhase: function (context, xcodeProjectPath) {
var xcode = context.requireCordovaModule("xcode");

// Read and parse the XCode project (.pxbproj) from disk.
// File format information: http://www.monobjc.net/xcode-project-file-format.html
Expand Down Expand Up @@ -85,7 +85,6 @@ module.exports = {
*/
removeShellScriptBuildPhase: function (context, xcodeProjectPath) {

var xcode = context.requireCordovaModule("xcode");

// Read and parse the XCode project (.pxbproj) from disk.
// File format information: http://www.monobjc.net/xcode-project-file-format.html
Expand Down
Loading

0 comments on commit db655c5

Please sign in to comment.