# How will Twitch Embed updates affect mobile app embeds?

**URL:** <https://discuss.dev.twitch.com/t/how-will-twitch-embed-updates-affect-mobile-app-embeds/26008>\
**Category:** API\
**Created:** [May 29, 2020, 9:35pm UTC](https://discuss.dev.twitch.com/t/how-will-twitch-embed-updates-affect-mobile-app-embeds/26008 "2020-05-29T21:35:19Z")\
**Posts on this page:** 1\
**Showing post:** 43

<div class="post-metadata">

**Author:** ![jbulava](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/jbulava/32/6777_2.png) [@jbulava](https://discuss.dev.twitch.com/u/jbulava)\
**Post date:** [July 27, 2020, 2:49am UTC](https://discuss.dev.twitch.com/t/how-will-twitch-embed-updates-affect-mobile-app-embeds/26008/43 "2020-07-27T02:49:12Z")

</div>

I was able to make this solution work for iOS and Android. In case it is helpful, let me share how I set up the tests.

The first thing I did was create an `index.html` file with the following code and uploaded it to my website. I’ll change the domain for the example to be `mywebsite.com` and the embed is therefore viewable at `https://mywebsite.com/embed`.

```
<!doctype html>

<html lang="en">
<head>
  <meta charset="utf-8">
</head>
<body>
  <iframe src="https://player.twitch.tv/?channel=insomniac&parent=mywebsite.com" frameborder="0" allowfullscreen="true" scrolling="no" height="378" width="620"></iframe>
</body>
</html>

```

* * *

To show this Twitch embed in iOS, I have a `ContentView.swift` file with the main struct defines like this:

```
struct ContentView: View {
    var body: some View {
        Webview(url: URL(string: "https://mywebsite.com/embed")!)
    }
}

```

Then I have the `scene` function in the scene delegate defined as seen below. That displays the Twitch embed as expected when opening the iOS phone simulator.

```
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {

    let contentView = ContentView()

    if let windowScene = scene as? UIWindowScene {
        let window = UIWindow(windowScene: windowScene)
        window.rootViewController = UIHostingController(rootView: contentView)
        self.window = window
        window.makeKeyAndVisible()
    }
}

```

* * *

For Android, I tried the example using Kotlin and API level 28. In my `MainActivity.kt` `onCreate` function, I set up a WebView like this, though removed a lot of settings for the sake of this post:

```
mWebView = findViewById<View>(R.id.webview) as WebView
mWebView.loadUrl("https://mywebsite.com/embed")

```

This displayed the Twitch embed in the WebView as expected on my virtual Pixel 3a that I set up for running the application.

---

_[View the full topic](https://discuss.dev.twitch.com/t/how-will-twitch-embed-updates-affect-mobile-app-embeds/26008)._
