I am new to developing. I have my website, Greasygamer.com, 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?
GET 'https://id.twitch.tv/oauth2/authorize?response_type=token&client_id=einlh0aqh6snec0a9n6s33c6o4ny30
&redirect_uri=http://localhost
&scope=viewing_activity_read
&state=c3ab8aa609ea11e793ae92361f002671'
Thanks in advance
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.
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?)
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 (https://greasygamer.com/streams) but going to that same site inside of my app, it doesn’t login to the app, but goes to the twitch site instead.
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
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() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url.contains("twitch"))
{
webView.loadUrl("https://id.twitch.tv/oauth2/authorize?response_type=token&client_id=9m0ldbpu7ranp6vrwvl501z50xyx2n&redirect_uri=https://greasygamer.com/streams&scope=viewing_activity_read");
} return false;
}
});
Am i missing a step to where it actually holds the token or something?