Private const API_KEY As String = "jpiadjfpadijPJIPOijpeijpe"
Sub ConnectFCM(unused As Byte)
If socket.ConnectHost("fcm.googleapis.com", 80) = False Then
Log("trying to connect again to FCM")
CallSubPlus("ConnectFCM", 1000, 0)
Return
End If
Log("Connected to server FCM")
astream.Initialize(socket.Stream, "Astream_NewData", "Astream_Error")
For i = 1 To 2
astream.Write("POST /fcm/send HTTP/1.1").Write(eol)
astream.Write("Host: fcm.googleapis.com").Write(eol)
astream.Write("Authorization: key=").Write(API_KEY).Write(eol)
astream.Write("Content-Type: application/json").Write(eol)
If i = 1 Then SendAndroid Else SendIOS
Next
End Sub