예제 #1
0
        private async Task ScDevice()
        {
            if (this.IsAuthenticated())
            {
                return;
            }

            await ProceedUtils.Proceed <bool?>(this.logger, async() =>
            {
                var session = this.storeService.GetScDevice();
                if (session != null)
                {
                    this.scDevice = session;
                    this.logger.LogTrace(this.scDevice.GetLog());
                    return(true);
                }

                var request = this.makeMoney.ScDevice.ScDevice(new ScDeviceRequest
                {
                    AutoName       = string.Empty,
                    Model          = "Android SDK built for x86",
                    UniqueId       = this.userSettings.UniqueId,
                    Manufacturer   = "Google",
                    AppVesrsion    = "4.0",
                    Carrier        = "Android",
                    Brand          = "google",
                    DeviceLanguage = "en-US",
                    FirebaseToken  = this.userSettings.FirebaseToken,
                    PushId         = string.Empty,
                    ReferalCode    = string.Empty,
                    DeploymentType = "1",
                    ScreenHeight   = "1794",
                    AutoEmail      = string.Empty,
                    OsVersion      = "9",
                    ScreenWidth    = "1080"
                }).SetDefault();

                var response = await request.ExecuteAsync();
                if (response == null)
                {
                    this.logger.LogError("Authorization failed.");
                    DelayUtils.LargeDelay();
                    return(null);
                }

                this.scDevice = response;
                this.logger.LogTrace(this.scDevice.GetLog());
                this.storeService.SaveScDevice(this.scDevice);
                this.isNewDevice = true;
                return(true);
            });
        }
예제 #2
0
 public void SaveScDevice(ScDeviceResponse scDevice)
 {
     this.Save(scDevice);
 }