Beispiel #1
0
        private void StartService(IMobileCenterService service)
        {
            if (service == null)
            {
                throw new MobileCenterException("Service instance is null; static 'Instance' property either doesn't exist or returned null");
            }
            if (_services.Contains(service))
            {
                ThrowStartedServiceException(service.GetType().Name);
            }

            service.OnChannelGroupReady(_channelGroup, _appSecret);
            _services.Add(service);
            MobileCenterLog.Info(MobileCenterLog.LogTag, $"'{service.GetType().Name}' service started.");
        }
Beispiel #2
0
 private void StartService(IMobileCenterService service)
 {
     if (service == null)
     {
         throw new MobileCenterException("Attempted to start an invalid Mobile Center service.");
     }
     if (_services.Contains(service))
     {
         MobileCenterLog.Warn(MobileCenterLog.LogTag, $"Mobile Center has already started the service with class name '{service.GetType().Name}'");
         return;
     }
     service.OnChannelGroupReady(_channelGroup, _appSecret);
     _services.Add(service);
     MobileCenterLog.Info(MobileCenterLog.LogTag, $"'{service.GetType().Name}' service started.");
 }