abema_onair_schedule.AbemaApi.getUserTokens(string)

Here are the examples of the csharp api class abema_onair_schedule.AbemaApi.getUserTokens(string) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Example 7

1. Example

Project: abema-tvguide
Source File: AbemaApi.cs
View license
public void loadToken() {
            // ???????????????
            if (loadSettingFile() && checkToken()) {
                return;
            }
            // ????????????
            Console.WriteLine("???????????????");
            String secretKey = getSecretKey();
            String deviceId, userId, authToken;
            long createdAt;
            {
                var r = getUserTokens(secretKey);
                deviceId = r.Item1;
                userId = r.Item2;
                createdAt = r.Item3;
                authToken = r.Item4;
            }
            {
                // ??
                var hash = new Dictionary<String, Object>();
                hash["SecretKey"] = secretKey;
                hash["DeviceId"] = deviceId;
                hash["UserId"] = userId;
                hash["CreatedAt"] = createdAt;
                hash["AuthToken"] = authToken;
                String saveJson = JsonConvert.SerializeObject(hash, Formatting.Indented);
                Console.WriteLine($"????????????\n{saveJson}");
                System.IO.File.WriteAllText(settingPath(), saveJson);
            }
            this.DeviceId = deviceId;
            this.UserId = userId;
            this.CreatedAt = createdAt;
            this.AuthToken = authToken;
            checkToken();
            System.Threading.Thread.Sleep(2 * 1000);
        }