void OnApplicationPause(bool paused) { if (this._pauseState == paused) { return; } this._pauseState = paused; if (paused) { this._executionQueue.Clear(); this._delayCalls.Clear(); this._delayCallId = 0; SocketApi.OnApplicationFocus(false); } else { if (!this._resumePending) { this._resumePending = true; this.Invoke(nameof(this.TryOnApplicationResumed), resumePendingDuration); } } }
void TryOnApplicationResumed() { this._resumePending = false; if (this._pauseState == false) { SocketApi.OnApplicationFocus(true); } }