Skip to content
Translate Ideas and Comments
Choose language:
There was an error during translation

Settings and activity

3 results found

  1. 2 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    An error occurred while saving the comment
    b00mzer commented  · 

    the sdk is not complete :/

    b00mzer supported this idea  · 
  2. 9 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    An error occurred while saving the comment
    b00mzer commented  · 

    Try that
    const float REFRESH_SECOND = 1;
    readonly TwitchOAuthScope[] SCOPES = new TwitchOAuthScope[] {
    TwitchOAuthScope.Bits.Read,
    TwitchOAuthScope.Channel.ManageBroadcast,
    TwitchOAuthScope.Channel.ManagePolls,
    TwitchOAuthScope.Channel.ManageRedemptions,
    TwitchOAuthScope.Channel.ReadHypeTrain,
    TwitchOAuthScope.Channel.ManagePredictions,
    TwitchOAuthScope.Clips.Edit,
    TwitchOAuthScope.User.ReadSubscriptions};

    GameTask<AuthenticationInfo> _authInfoTask;
    GameTask<AuthState> _curAuthState;

    /// <summary>
    /// Thread for the connection to twitch API
    /// </summary>
    /// <returns></returns>
    private void ConnectionToApplicationAPI()
    {
    switch (_curAuthState.MaybeResult.Status)
    {
    case AuthStatus.LoggedIn:
    break;

    case AuthStatus.WaitingForCode:
    break;

    case AuthStatus.LoggedOut:
    case AuthStatus.Loading:
    //Remake a connection
    if (_authInfoTask == null)
    _authInfoTask = Twitch.API.GetAuthenticationInfo(SCOPES);

    StartCoroutine(CheckAuthInfoTask());
    break;
    }
    }

    /// <summary>
    /// Thread to open a web page for logging the user
    /// </summary>
    /// <returns></returns>
    IEnumerator CheckAuthInfoTask ()
    {
    while (true)
    {
    switch (_authInfoTask.Task.Status)
    {
    case TaskStatus.Created:
    case TaskStatus.WaitingForActivation:
    case TaskStatus.WaitingToRun:
    case TaskStatus.Running:
    case TaskStatus.WaitingForChildrenToComplete:
    case TaskStatus.RanToCompletion:
    Application.OpenURL(_authInfoTask.Task.Result.Uri);
    yield break;
    case TaskStatus.Canceled:
    yield break;
    case TaskStatus.Faulted:
    yield break;
    }

    yield return new WaitForSeconds(REFRESH_SECOND);
    }
    }

    b00mzer supported this idea  · 
  3. 20 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    An error occurred while saving the comment
    b00mzer commented  · 

    On unity I solved the problem

    const float REFRESH_SECOND = 1;
    readonly TwitchOAuthScope[] SCOPES = new TwitchOAuthScope[] {
    TwitchOAuthScope.Bits.Read,
    TwitchOAuthScope.Channel.ManageBroadcast,
    TwitchOAuthScope.Channel.ManagePolls,
    TwitchOAuthScope.Channel.ManageRedemptions,
    TwitchOAuthScope.Channel.ReadHypeTrain,
    TwitchOAuthScope.Channel.ManagePredictions,
    TwitchOAuthScope.Clips.Edit,
    TwitchOAuthScope.User.ReadSubscriptions};

    GameTask<AuthenticationInfo> _authInfoTask;
    GameTask<AuthState> _curAuthState;

    /// <summary>
    /// Thread for the connection to twitch API
    /// </summary>
    /// <returns></returns>
    private void ConnectionToApplicationAPI()
    {
    switch (_curAuthState.MaybeResult.Status)
    {
    case AuthStatus.LoggedIn:
    break;

    case AuthStatus.WaitingForCode:
    break;

    case AuthStatus.LoggedOut:
    case AuthStatus.Loading:
    //Remake a connection
    if (_authInfoTask == null)
    _authInfoTask = Twitch.API.GetAuthenticationInfo(SCOPES);

    StartCoroutine(CheckAuthInfoTask());
    break;
    }
    }

    /// <summary>
    /// Thread to open a web page for logging the user
    /// </summary>
    /// <returns></returns>
    IEnumerator CheckAuthInfoTask ()
    {
    while (true)
    {
    switch (_authInfoTask.Task.Status)
    {
    case TaskStatus.Created:
    case TaskStatus.WaitingForActivation:
    case TaskStatus.WaitingToRun:
    case TaskStatus.Running:
    case TaskStatus.WaitingForChildrenToComplete:
    case TaskStatus.RanToCompletion:
    Application.OpenURL(_authInfoTask.Task.Result.Uri);
    yield break;
    case TaskStatus.Canceled:
    yield break;
    case TaskStatus.Faulted:
    yield break;
    }

    yield return new WaitForSeconds(REFRESH_SECOND);
    }
    }

    b00mzer supported this idea  ·