Sep 29, 2016 Replies: 12 Inspired by this example: https://dzone.com/articles/iot-push-notifications-arduino I've created a similar solution in B4X. When the button is clicked, two http requests are sent to Firebase REST api. Any subscribed Android or iOS device will receive the push message. It is a very simple and powerful solution. It is simple as you don't need a server and it is powerful as the messages will arrive even when the apps are not running. The solution works over the internet, it is not limited to the local network. B4A app: https://www.b4x.com/android/forum/threads/67716/#content B4i app: FirebaseNotifications / Push Messages (server not required) The B4R code is attached. You need to update the API_KEY and the wifi related settings. Attachments ESP8266_Push.zip ESP8266_Push.zip 1.5 KB · Views: 2,946 Click to expand...
Inspired by this example: https://dzone.com/articles/iot-push-notifications-arduino I've created a similar solution in B4X. When the button is clicked, two http requests are sent to Firebase REST api. Any subscribed Android or iOS device will receive the push message. It is a very simple and powerful solution. It is simple as you don't need a server and it is powerful as the messages will arrive even when the apps are not running. The solution works over the internet, it is not limited to the local network. B4A app: https://www.b4x.com/android/forum/threads/67716/#content B4i app: FirebaseNotifications / Push Messages (server not required) The B4R code is attached. You need to update the API_KEY and the wifi related settings.
BillMeyer Well-Known Member Licensed User Longtime User Sep 29, 2016 #2 A Very BIG Thank you. This opens up a whole new world of possibilities.
Cableguy Expert Licensed User Longtime User Sep 29, 2016 #3 is it possible to target individual devices from those subscribed in firebase?
Erel B4X founder Staff member Licensed User Longtime User Sep 30, 2016 #4 Cableguy said: is it possible to target individual devices from those subscribed in firebase? Click to expand... Yes. You can subscribe each device to a unique topic id and then send the message to the specific topic. Note that you also need to update the content length field.
Cableguy said: is it possible to target individual devices from those subscribed in firebase? Click to expand... Yes. You can subscribe each device to a unique topic id and then send the message to the specific topic. Note that you also need to update the content length field.
LWGShane Well-Known Member Licensed User Longtime User Oct 10, 2016 #5 Very interesting code. Looks like a very easy way to use push notifications. I might try to build a library for the other platforms to enable easy notifications.
Very interesting code. Looks like a very easy way to use push notifications. I might try to build a library for the other platforms to enable easy notifications.
JMB Active Member Licensed User Longtime User Mar 11, 2017 #7 Thanks Peter. I will check that out. Do you have to register your devices with the Firebase service? JMB
Thanks Peter. I will check that out. Do you have to register your devices with the Firebase service? JMB
Erel B4X founder Staff member Licensed User Longtime User Mar 12, 2017 #8 JMB said: Do you have to register your devices with the Firebase service? Click to expand... See this tutorial: https://www.b4x.com/android/forum/threads/67716/#content
JMB said: Do you have to register your devices with the Firebase service? Click to expand... See this tutorial: https://www.b4x.com/android/forum/threads/67716/#content
JMB Active Member Licensed User Longtime User Mar 12, 2017 #9 Thanks Erel. Will check that out. It's been a LONG time, but am loving getting back into this stuff. Amazing set of software. JMB
Thanks Erel. Will check that out. It's been a LONG time, but am loving getting back into this stuff. Amazing set of software. JMB
J Julius B. New Member Apr 1, 2018 #10 Can you please guide me step by step in how to do this? Also, can I do this with Arduino Uno + ESP8266?
Can you please guide me step by step in how to do this? Also, can I do this with Arduino Uno + ESP8266?
Erel B4X founder Staff member Licensed User Longtime User Apr 3, 2018 #11 Julius B. said: Also, can I do this with Arduino Uno + ESP8266? Click to expand... No and it is not needed. You should program the ESP8266 directly. Julius B. said: Can you please guide me step by step in how to do this? Click to expand... I recommend you to start with B4A tutorials. There is also a tutorial about push notifications. https://www.b4x.com/etp.html
Julius B. said: Also, can I do this with Arduino Uno + ESP8266? Click to expand... No and it is not needed. You should program the ESP8266 directly. Julius B. said: Can you please guide me step by step in how to do this? Click to expand... I recommend you to start with B4A tutorials. There is also a tutorial about push notifications. https://www.b4x.com/etp.html
J Julius B. New Member Apr 3, 2018 #12 Erel said: No and it is not needed. You should program the ESP8266 directly. I recommend you to start with B4A tutorials. There is also a tutorial about push notifications. https://www.b4x.com/etp.html Click to expand... If I only program the ESP8266, how will the button send the message?
Erel said: No and it is not needed. You should program the ESP8266 directly. I recommend you to start with B4A tutorials. There is also a tutorial about push notifications. https://www.b4x.com/etp.html Click to expand... If I only program the ESP8266, how will the button send the message?
Erel B4X founder Staff member Licensed User Longtime User Apr 4, 2018 #13 You cannot send push messages without a native Android or iOS app that receives the messages.