Firebase Trace network call only if request was successful?

163 Views Asked by At

I am trying to send network trace in firebase, but I only want to trace if the request was successful, if user network is not present (mobile data/Wi-Fi) then for that case I don't want any trace for this request.

Is there any way by which I can restart trace again, and stop it only if the request is successful?

Just by calling trace.start() again will it work?

1

There are 1 best solutions below

0
On BEST ANSWER

If you want to restart the trace, just create a new Trace object, start it, and let the old one get garbage collected.