firebase-messaging
Advanced tools
Comparing version 1.0.5 to 1.0.6
11
index.js
@@ -28,3 +28,3 @@ var request = require("request"); | ||
json.to = to; | ||
json[typeof to === "object" && to instanceof Array ? "registration_ids" : "to"] = to; | ||
json.data = data; | ||
@@ -41,9 +41,10 @@ | ||
if (cb) | ||
if (body != null) | ||
if (body !== null) | ||
try { | ||
cb(JSON.parse(body)); | ||
} catch (err) { | ||
} catch (e) { | ||
cb(body); | ||
} else | ||
cb(err); | ||
} | ||
else | ||
cb(err); | ||
@@ -50,0 +51,0 @@ }); |
{ | ||
"name": "firebase-messaging", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Module to send firebase messages", | ||
@@ -25,2 +25,2 @@ "main": "index.js", | ||
"homepage": "https://github.com/fcannizzaro/firebase-messaging#readme" | ||
} | ||
} |
4953
46