cordova-plugin-firebase
Advanced tools
Comparing version 0.1.9 to 0.1.10
@@ -11,3 +11,3 @@ { | ||
"name": "cordova-plugin-firebase", | ||
"version": "0.1.9", | ||
"version": "0.1.10", | ||
"description": "Cordova plugin for Google Firebase", | ||
@@ -14,0 +14,0 @@ "cordova": { |
@@ -6,4 +6,2 @@ # cordova-plugin-firebase | ||
Angular implementation is maintained in the [angular-cordova](https://github.com/arnesson/angular-cordova) project ([source](https://github.com/arnesson/angular-cordova/blob/master/src/plugins/3rdparty/firebase.js)) | ||
## Installation | ||
@@ -14,3 +12,3 @@ See npm package for versions - https://www.npmjs.com/package/cordova-plugin-firebase | ||
``` | ||
<plugin name="cordova-plugin-firebase" spec="0.1.9" /> | ||
<plugin name="cordova-plugin-firebase" spec="0.1.10" /> | ||
``` | ||
@@ -53,2 +51,13 @@ or by running: | ||
### onNotificationOpen (Android only) | ||
Register notification callback: | ||
``` | ||
window.FirebasePlugin.onNotificationOpen(function(success) { | ||
console.error(success); | ||
}, function(error) { | ||
console.error(error); | ||
}); | ||
``` | ||
### grantPermission (iOS only) | ||
@@ -61,2 +70,23 @@ | ||
### setBadgeNumber | ||
Set a number on the icon badge: | ||
``` | ||
window.FirebasePlugin.setBadgeNumber(3); | ||
``` | ||
Set 0 to clear the badge | ||
``` | ||
window.FirebasePlugin.setBadgeNumber(0); | ||
``` | ||
### getBadgeNumber | ||
Get icon badge number: | ||
``` | ||
window.FirebasePlugin.getBadgeNumber(function(n) { | ||
console.log(n); | ||
}); | ||
``` | ||
### subscribe | ||
@@ -80,3 +110,3 @@ | ||
``` | ||
window.FirebasePlugin.logEvent("pageLoad", "Dashboard"); | ||
window.FirebasePlugin.logEvent("page_view", {page: "dashboard"}); | ||
``` | ||
@@ -83,0 +113,0 @@ |
@@ -24,6 +24,15 @@ #!/usr/bin/env node | ||
function directoryExists(path) { | ||
try { | ||
return fs.statSync(path).isDirectory(); | ||
} | ||
catch (e) { | ||
return false; | ||
} | ||
} | ||
var config = fs.readFileSync("config.xml").toString() | ||
var name = getValue(config, "name") | ||
if(fileExists("GoogleService-Info.plist")){ | ||
if(fileExists("GoogleService-Info.plist") && directoryExists("platforms/ios/")){ | ||
try { | ||
@@ -37,3 +46,3 @@ var contents = fs.readFileSync("GoogleService-Info.plist").toString(); | ||
if(fileExists("google-services.json")){ | ||
if(fileExists("google-services.json") && directoryExists("platforms/android/")){ | ||
try { | ||
@@ -40,0 +49,0 @@ var contents = fs.readFileSync("google-services.json").toString(); |
@@ -31,4 +31,4 @@ var exec = require('cordova/exec'); | ||
exports.logEvent = function(key, value, success, error) { | ||
exec(success, error, "FirebasePlugin", "logEvent", [key, value]); | ||
exports.logEvent = function(name, params, success, error) { | ||
exec(success, error, "FirebasePlugin", "logEvent", [name, params]); | ||
}; | ||
@@ -35,0 +35,0 @@ |
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
29898110
132
219