Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Power Lifting Lever Belt
SkullVamp
Updated:
Jun 13, 2026
Ad icon
port.lk Domain for sale
Lankan-Tech
Updated:
Jun 13, 2026
Colombo
Kaduwela - Two Storey House for Sale
dilrasan
Updated:
Jun 11, 2026
Ad icon
Wechat qr verification
Pawan2005
Updated:
Jun 11, 2026
🚀 GOOGLE AI PRO 18 MONTHS ACTIVATION 🚀
sayuru bandara
Updated:
Jun 10, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Talk!
Help ekak one Android programming waddek gen..........
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="Chandi_Bandi" data-source="post: 27983234" data-attributes="member: 557924"><p>Machanla mekai case eka, campus eke final project eka, garbage bin collect karana project ekak. mama android danne naha, yaluwekta kiyala hada gatte,</p><p>eke firebase function eken push notification ekak yanawa garbage bin eka full nam. mata one e notification ekata interval ekak set kara ganna. danna kenek innawa nm help ekak dihallako...............</p><p></p><p>[CODE]const functions = require('firebase-functions');</p><p>const admin = require('firebase-admin');</p><p></p><p>admin.initializeApp();</p><p></p><p>var msgData;</p><p></p><p>exports.SendNotification = functions.database.ref()</p><p> .onUpdate((snapshot, context) => {</p><p> var newval = snapshot.after.val();</p><p> if (newval.precent >= 20 && newval.status == false) {</p><p> var payload = {</p><p> "notification": {</p><p> "title": "Smart Bin Collect",</p><p> "body": "Bin is full , now you can collect garbage bin " + newval.name,</p><p> "sound": "default"</p><p> }</p><p> }</p><p> //create topics</p><p> var topics = "notification"</p><p> </p><p> return admin.messaging().sendToTopic(topics, payload).then((response) => {</p><p> console.log('Pushed them all');</p><p> }).catch((err) => {</p><p> console.log(err);</p><p> });</p><p> }</p><p> log(newval.precent);</p><p> //Your notification code here</p><p> });[/CODE]</p></blockquote><p></p>
[QUOTE="Chandi_Bandi, post: 27983234, member: 557924"] Machanla mekai case eka, campus eke final project eka, garbage bin collect karana project ekak. mama android danne naha, yaluwekta kiyala hada gatte, eke firebase function eken push notification ekak yanawa garbage bin eka full nam. mata one e notification ekata interval ekak set kara ganna. danna kenek innawa nm help ekak dihallako............... [CODE]const functions = require('firebase-functions'); const admin = require('firebase-admin'); admin.initializeApp(); var msgData; exports.SendNotification = functions.database.ref() .onUpdate((snapshot, context) => { var newval = snapshot.after.val(); if (newval.precent >= 20 && newval.status == false) { var payload = { "notification": { "title": "Smart Bin Collect", "body": "Bin is full , now you can collect garbage bin " + newval.name, "sound": "default" } } //create topics var topics = "notification" return admin.messaging().sendToTopic(topics, payload).then((response) => { console.log('Pushed them all'); }).catch((err) => { console.log(err); }); } log(newval.precent); //Your notification code here });[/CODE] [/QUOTE]
Insert quotes…
Verification
Hata thunen beduwama keeyada? (60 bedeema thuna)
Post reply
Top
Bottom