Hi guys, im starting to programing with this API and i want to make an Android apk, but first i try the code i want to use in Java mode. I was able to get some information with the API but the problem was when i try to get de Subscribers of an User. After searching i discover that i have to make an Authentication page, so i do the following:
1- Download this https://github.com/mb3364/Java-Twitch-Api-Wrapper and using it as a Lib.
2- Test this simple code to make sure im doing a good work:
At what point is it getting stuck? Your Java app should open a browser window pointing to Twitch. You should permit the app access, which redirects you back to the app’s callbackUri, which tells the app the it’s found the token and the authorization should be successful.
If you never get a browser window, then your code is breaking when it tries to open a browser. If it never gets past authorizing the app with Twitch (ie you’re redirected back and nothing happens), java.awt.Desktop.getDesktop().browse may be a blocking call that you need to initiate in a separate thread.
The function twitch.auth().awaitAccessToken(); never ends, it keeps waiting, but never returns true or false even when i can see the token access in the browser. Can it be because of my Redirect URI? I have “http://127.0.0.1:23522/token/” but i dont know if is a good practice or not.