Ejemplo n.º 1
0
        internal async Task <Resource> InternalResolveByCanonicalUri(string url)
        {
            var resource = await AsyncResolver.ResolveByCanonicalUriAsync(url).ConfigureAwait(false);

            OnLoad(url, resource);
            return(resource);
        }
Ejemplo n.º 2
0
        private void StartOrientationCheck()
        {
            Log.Debug("StartOrientationCheck");

            if (_intervalId == AsyncResolver.DefaultCallId)
            {
                _intervalId = AsyncResolver.IntervalCall(CheckOrientation, OrientationCheckTimeout);
            }
        }
Ejemplo n.º 3
0
        private void OnAuthorized(AuthorizationRequest request)
        {
            if (request.Granted)
            {
                Log.Debug(t => $"Authorized. DeviceToken: {t}", request.DeviceToken);

                _status      = AuthorizationStatus.Authorized;
                _deviceToken = request.DeviceToken;

                if (_notificationToSchedule != null)
                {
                    // Delay needed as notifications scheduled right away don't work.
                    _callId = AsyncResolver.DelayedCall(() =>
                    {
                        // If any notifications were requested before authorization, they must be scheduled after it.
                        foreach (var notification in _notificationToSchedule)
                        {
                            ScheduleNotificationImpl(notification);
                        }

                        // Cleaning notification.
                        _notificationToSchedule = null;
                    }, 0.1F);
                }
            }
            else if (request.Error != null)
            {
                Log.Error(e => $"Authorization error: {e}", request.Error);

                _status = AuthorizationStatus.Denied;
            }
            else
            {
                Log.Debug("Not authorized. User denied notifications request.");

                _status = AuthorizationStatus.Denied;
            }

            CompleteInitialization();
        }
Ejemplo n.º 4
0
        private void StopOrientationCheck()
        {
            Log.Debug("StopOrientationCheck");

            AsyncResolver.CancelCall(ref _intervalId);
        }
Ejemplo n.º 5
0
 public void PreDestroy()
 {
     CoroutineProvider.StopCoroutine(ref _coroutine);
     AsyncResolver.CancelCall(ref _callId);
 }