cordova-plugin-firebase
Advanced tools
Comparing version 0.1.22 to 0.1.23
@@ -11,3 +11,3 @@ { | ||
"name": "cordova-plugin-firebase", | ||
"version": "0.1.22", | ||
"version": "0.1.23", | ||
"description": "Cordova plugin for Google Firebase", | ||
@@ -14,0 +14,0 @@ "cordova": { |
@@ -10,7 +10,7 @@ # cordova-plugin-firebase | ||
``` | ||
<plugin name="cordova-plugin-firebase" spec="0.1.22" /> | ||
<plugin name="cordova-plugin-firebase" spec="0.1.23" /> | ||
``` | ||
or by running: | ||
``` | ||
cordova plugin add cordova-plugin-firebase@0.1.22 --save | ||
cordova plugin add cordova-plugin-firebase@0.1.23 --save | ||
``` | ||
@@ -17,0 +17,0 @@ 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: |
@@ -44,3 +44,2 @@ #!/usr/bin/env node | ||
fs.writeFileSync("platforms/ios/" + name + "/Resources/GoogleService-Info.plist", contents) | ||
fs.writeFileSync("platforms/ios/" + name + "/Resources/Resources/GoogleService-Info.plist", contents) | ||
} catch(err) { | ||
@@ -64,21 +63,24 @@ process.stdout.write(err); | ||
var json = JSON.parse(contents); | ||
var strings = fs.readFileSync("platforms/android/res/values/strings.xml").toString(); | ||
if (contents) { | ||
var json = JSON.parse(contents); | ||
// strip non-default value | ||
strings = strings.replace(new RegExp('<string name="google_app_id">([^\@<]+?)<\/string>', "i"), '') | ||
var strings = fs.readFileSync("platforms/android/res/values/strings.xml").toString(); | ||
// strip non-default value | ||
strings = strings.replace(new RegExp('<string name="google_api_key">([^\@<]+?)<\/string>', "i"), '') | ||
// strip non-default value | ||
strings = strings.replace(new RegExp('<string name="google_app_id">([^\@<]+?)<\/string>', "i"), '') | ||
// strip empty lines | ||
strings = strings.replace(new RegExp('(\r\n|\n|\r)[ \t]*(\r\n|\n|\r)', "gm"), '$1') | ||
// strip non-default value | ||
strings = strings.replace(new RegExp('<string name="google_api_key">([^\@<]+?)<\/string>', "i"), '') | ||
// replace the default value | ||
strings = strings.replace(new RegExp('<string name="google_app_id">([^<]+?)<\/string>', "i"), '<string name="google_app_id">' + json.client[0].client_info.mobilesdk_app_id + '</string>') | ||
// strip empty lines | ||
strings = strings.replace(new RegExp('(\r\n|\n|\r)[ \t]*(\r\n|\n|\r)', "gm"), '$1') | ||
// replace the default value | ||
strings = strings.replace(new RegExp('<string name="google_api_key">([^<]+?)<\/string>', "i"), '<string name="google_api_key">' + json.client[0].api_key[0].current_key + '</string>') | ||
// replace the default value | ||
strings = strings.replace(new RegExp('<string name="google_app_id">([^<]+?)<\/string>', "i"), '<string name="google_app_id">' + json.client[0].client_info.mobilesdk_app_id + '</string>') | ||
fs.writeFileSync("platforms/android/res/values/strings.xml", strings); | ||
// replace the default value | ||
strings = strings.replace(new RegExp('<string name="google_api_key">([^<]+?)<\/string>', "i"), '<string name="google_api_key">' + json.client[0].api_key[0].current_key + '</string>') | ||
fs.writeFileSync("platforms/android/res/values/strings.xml", strings); | ||
} | ||
} catch(err) { | ||
@@ -85,0 +87,0 @@ process.stdout.write(err); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
63551415
269