JH1
June 17, 2022, 6:31am
1
Hello, Is there a way to retrieve specific data from firebase and send a notification whenever a new entry in that firebase tag is made?
A python script is sending this data to firebase whenever there's an error. SO I'd like to retrieve the actual warning "its time to take your medication" and turn it into a notification to send to the user.
Can anyone help with the blocks please?
TIMAI2
June 17, 2022, 4:45pm
2
Getting the data from firebase should be straightforward enough:
Not used any notification extensions, so cannot help there.
If you only need a notifier, then set the web1.GotText to a message dialog.
JH1
June 17, 2022, 5:04pm
3
Thank You,
the extension I want to use is Simple Notification Extension .
I have no blocks for it because I was unsure where to place it, I want the notification to be sent automatically if firebase gets a new entry and not based on a button being pressed.
Where should I put that block? when the screen is initialised?
TIMAI2
June 17, 2022, 5:47pm
4
You probably want the dataChanged event from the Firebase component. This may work.
JH1
June 17, 2022, 5:50pm
5
Okay I will try and let you know if it worked, Thank you
JH1
June 17, 2022, 7:10pm
6
Hi what was global fbUrl initialised as? and does the global fbUrl tag have the warning text in it?
JH1
June 18, 2022, 3:54am
8
Yes but what would global fbUrl be initialised to? Is it the firebase link?
TIMAI2
June 18, 2022, 8:36am
9
JH1:
Is it the firebase link?
Yes, it is what you would place here with the firebase component
1 Like
JH1
June 18, 2022, 12:45pm
10
I've tried the blocks above but I didn't get an alert when I manually added text to the Alerts tag in firebase. Did I miss something you mentioned?
TIMAI2
June 18, 2022, 12:54pm
11
Two things:
You included .json
at the end of your tag
This is not required, or in the blocks I showed you. Remove .json
You may need to set data to Firebase from your app in order to activate dataChanged. You can just send a dummy tag/value to do this.
JH1
June 18, 2022, 1:47pm
12
I have tried and I do not get any alerts in the app.
Should I have implemented the web.got text as well?
TIMAI2
June 18, 2022, 3:02pm
13
This should not be required
What is your ProjectBucket set to? It should be the node above Automatic_Pill_DspenserAlerts
?
Have you made any changes to the data in the console ?
Have you tried to change the message, a data change is required to trigger the dataChange event?
TIMAI2
June 18, 2022, 3:17pm
14
Just run a test, seems dataChanged cannot cope with a path to a tag, try like this:
JH1
June 18, 2022, 3:36pm
15
No luck using that method either. I did it like you had it at first then I set the project bucket and still, no alerts shown
TIMAI2
June 18, 2022, 4:08pm
16
I will have to assume (without any other information) that your tag Automatic_Pill_DspenserAlerts
is below your project name: automaticpilldispenser-bc076-default....
Make the following adjustments to your blocks
Remember data needs to change in order to trigger the dataChanged event
JH1
June 18, 2022, 6:54pm
17
It worked! Thank you so much.
Do you think it would work with this extension Notification so the alerts can be received when the app is closed?
JH1
June 18, 2022, 7:43pm
19
It worked, Thank you so much for the help!
system
Closed
June 25, 2022, 7:43pm
20
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.