From 7e48adf3ef6782aa3e8a7202d0961abb6d7e3cbe Mon Sep 17 00:00:00 2001 From: Abdulrahman Abdulkarim Date: Thu, 14 May 2020 15:45:20 +0100 Subject: [PATCH 1/2] Update index.js to fix issues --- cloud-functions/functions/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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: { From 42c03f329f3333eedaf5677623863cd7b643fa99 Mon Sep 17 00:00:00 2001 From: Abdulrahman Abdulkarim Date: Fri, 15 May 2020 10:40:47 +0100 Subject: [PATCH 2/2] minor code changes to .gitignore and build.gradle files --- .gitignore | 1 + build.gradle | 8 ++++++++ 2 files changed, 9 insertions(+) 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' + } } }