B4R Question ESP8266 & Firebase Push Messages

microbox

Active Member
Licensed User
Longtime User
Hi, I'm using Erel's tutorial on Firebase Push Messages using ESP8266. I was able to receive messages but I want to learn how to add data in the body. How will I go about to insert a variable containing a text value? The following is what I'm using
B4X:
Sub SendAndroid
    astream.Write("Connection: keep-alive").Write(eol) '<--- keep-alive
    astream.Write("Content-Length: ").Write(NumberFormat(57 + storedMessage.Length, 0, 0)).Write(eol)
    astream.Write(eol)
    astream.Write("{""data"":{""title"":""").Write(storedMessage).Write(""",""body"":""""},""to"":""\/topics\/general""}")
End Sub


Thanks,
Joe
 
Top