Plutoam
Member
Hello, I am using the latest update of the OkhttpUtils2 library, which is version 3.02, in the FirebaseMessaging Receiver, some requests are not executed.
It gives very strange errors
Sometimes it even gives an error, but the request is executed and sent to the server
And when the program is closed, my request is sent to Firebase and even Http2Service is started, but the request is not sent.
What is wrong ?
And let me add that the domain to which I send the request has no problem
Requests are sent to the domain even as long as the program is not closed
But as soon as I close the program, either the request does not go, or I receive this error
Sometimes a request is sent even with an error
Here Is My Code in FirebaseMessaging Receiver
* and I tested SDK 30, SDK 31, SDK 32, SDK 33 and I still have the same problem.
It gives very strange errors
Sometimes it even gives an error, but the request is executed and sent to the server
And when the program is closed, my request is sent to Firebase and even Http2Service is started, but the request is not sent.
What is wrong ?
Errors:
*** Receiver (httputils2service) Receive ***
ResponseError. Reason: java.net.UnknownHostException: Unable to resolve host "MyDomain.Com": No address associated with hostname, Response:
And let me add that the domain to which I send the request has no problem
Requests are sent to the domain even as long as the program is not closed
But as soon as I close the program, either the request does not go, or I receive this error
Sometimes a request is sent even with an error
Here Is My Code in FirebaseMessaging Receiver
My Codes:
jsondata.Initialize
jsondata.Clear
jsondata.Put("action","newdevice")
jsondata.Put("androidid",androidid)
jsondata.Put("model",model)
sendreq("https://myDomain.com",jsonen(jsondata))
Sub jsonen(data As Map) As String
json.Initialize(data)
Return json.ToString
End Sub
Sub sendreq(url As String,data As String)
ht.Initialize("",Me)
ht.PostString(url,data)
ht.Release
End Sub
* and I tested SDK 30, SDK 31, SDK 32, SDK 33 and I still have the same problem.