Issues with Webview and OAuth

I am new to developing. I have my website,, as a webview in Android and iOS apps. When using the browsers, Twitch auth works as intended.

Inside the Webviews, it’s either it doesn’t pass the auth tokens (android) or it says to disable pop up blocker (iOS)

Anyways, I understand the Get() setup, i just dont know how to declare it and call it when the button is clicked. Am i missing something easy?
Here is the GET with the code fille din, where do i put this at? Inside a Func?


Thanks in advance

That would be because it’s supposed to be a redirect/link out to Twitch, not a GET request via curl or similar.

Step 1 of oAuth is redirecting the user to Twitch

1 Like

Thanks for the response. So, instead of GET it would be REDIRECT? and where do I put that at? I am confused on how to code this I guess?

Thank you

I suppose you would open a webview to that URL

So open another webview inside my webview and how would that pass the token to the main webview?

Is there a tutorial I could follow? The Twitch steps here are not helping :frowning:

Implicit flow should just work on the page you are on, assuming you can get a good redirect URL back to your app, if the apps URL is localhost on the app.

As an working example code:

1 Like

Okay man. Thank you for the example!

So i created a seperate javascript file with the code in it. How exactly do I tell it to call it when the button is clicked (the embed chat is controlled by Twitch right? like i can’t change the OnClick function?)

You never mentioned embed chat.

Embedding is covered here

And it handles authentication on it’s own

Even inside of a webview?

Because that works fine in web browsers, but when I create a webview in my iOS or Android Studio app, it doesn’t pass the tokens

I don’t know I don’t have the requistite things to hand to test

What doesn’t pass the tokens? Implicity auth or the embed?

My app is a webview of my website (basically the app is my website, just mobile sized)

Inside of that, the twitch embed doesnt work quite right. When i click the login to chat button, it lets me sign in, but then it redirects to the web version on Twitch, even though i have: &no-mobile-redirect=true" at the end of the twitch link

As i said, it works fine when you go to the website ( but going to that same site inside of my app, it doesn’t login to the app, but goes to the twitch site instead.

hope that helps man

I don’t believe this is a documented thing you can use that I’ve seen anywhere.

Not sure if bug or that the embed’s are not intended to behave/work with login on Mobile webviews.

Might be one for uservoice or the issue tracker

Hmm okay i see. So what is my next step? Do i need to talk to a Twitch dev or Android dev or what? I just wanna get this functionalit working so that it works within my Webview app

It seems like something changed with webviews in march, having done a quick forum search.

I’ve copied the threads to someone to pass around

1 Like

Okay thanks for your help barry. I guess I will just have to wait to hear back lol

Update: I was able to set this up in my webview to redirect Twitch url opening, to my Redirect URI instead. So now it redirects properly and i click the “Authorize button” and it send me back to my site, but when i go back to the chat, it has me do the loop all over again.

  webView.setWebViewClient(new WebViewClient() {
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            if (url.contains("twitch"))

            } return false;


Am i missing a step to where it actually holds the token or something?

I just need to know how to take the redirected user and get the token to the validator website so when they go to the stream chat, it works.

Becuase your code gets an oAuth took for your Application. ID’ed by 9m0ldbpu7ranp6vrwvl501z50xyx2n

It doesn’t log you into the embed chat so you can send/receive chat.

Also you requested viewing_activity_read thats the Drops scope, I don’t think you are building drops here

So what would be the fix then? I am confused on this issue, sorry