Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/local.properties
/.idea/workspace.xml
/.idea/libraries
/.idea
.DS_Store
/build
/captures
Expand Down
8 changes: 8 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -16,6 +20,10 @@ buildscript {
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions cloud-functions/functions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down