diff --git a/.gitignore b/.gitignore index 39fb081..fc83475 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ /local.properties /.idea/workspace.xml /.idea/libraries +/.idea .DS_Store /build /captures diff --git a/build.gradle b/build.gradle index a746e06..2f47b95 100644 --- a/build.gradle +++ b/build.gradle @@ -3,6 +3,10 @@ buildscript { repositories { jcenter() + maven { + url 'https://maven.google.com/' + name 'Google' + } } dependencies { classpath 'com.android.tools.build:gradle:2.2.0' @@ -16,6 +20,10 @@ buildscript { allprojects { repositories { jcenter() + maven { + url 'https://maven.google.com/' + name 'Google' + } } } diff --git a/cloud-functions/functions/index.js b/cloud-functions/functions/index.js index 192da4e..eeeb6c1 100644 --- a/cloud-functions/functions/index.js +++ b/cloud-functions/functions/index.js @@ -16,12 +16,12 @@ admin.initializeApp(functions.config().firebase); // }); // }); -exports.pushNotification = functions.database.ref('/messages/{pushId}').onWrite( event => { +exports.pushNotification = functions.database.ref('/messages/{pushId}').onWrite( (change, event) => { console.log('Push notification event triggered'); // Grab the current value of what was written to the Realtime Database. - var valueObject = event.data.val(); + var valueObject = change.after.val(); const payload = { notification: {