playgen.io

Documentation

Installation

Embed and Integration

Embedding Games via iFrame and Native Applications

Integrating playgen.io games into your platform is straightforward, whether you're embedding them on a website or within a native mobile application. Below are the methods to seamlessly incorporate our games into your environment.

Embedding Games via iFrame

To embed a game on your website using an iFrame, insert the following HTML code into your webpage:

<iframe
  src="https://<game_type>.playgen.io/game/<publish_key>"
  width="100%"
  height="700px"
  frameborder="0"
  allowfullscreen
  allow="web-share"
></iframe>

Replace <publish_key> and <game_type> with your specific game publish key and game type. This iFrame is responsive, adapting to various screen sizes, and ensures a consistent user experience. For more details, refer to our [Games Integration Guide][1].

Integrating Games into Native Applications

For native mobile applications, you can integrate playgen.io games using WebView components. Below are examples for iOS and Android platforms.

iOS Integration

Utilize the WKWebView class to embed the game within your iOS application:

import WebKit
 
class GameViewController: UIViewController {
    override func viewDidLoad() {
        super.viewDidLoad()
        let webView = WKWebView(frame: view.bounds)
        webView.load(URLRequest(url: URL(string: "https://<game_type>.playgen.io/game/<publish_key>")!))
        view.addSubview(webView)
    }
}

Ensure you replace <publish_key> with your actual game publish key. This setup allows the game to run seamlessly within your app. For more information, consult our [Games Integration Guide][1].

Android Integration

In Android, use the WebView component to embed the game:

WebView webView = findViewById(R.id.webview);
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl("https://<game_type>.playgen.io/game/<publish_key>");

Replace <publish_key> with your specific game publish key. This approach ensures smooth integration of the game within your Android application. Detailed instructions are available in our [Games Integration Guide][1].

Platform-Specific Integration

playgen.io supports integration with various platforms. Below are platform-specific instructions:

PlatformIntegration Method
WordPressUse the [iframe] shortcode: [iframe src="https://<game_type>.playgen.io/game/<publish_key>" width="100%" height="700"]
WixAdd an "HTML iframe" element and insert the iFrame code provided above.
SquarespaceAdd a "Code" block and insert the iFrame code provided above.
FramerAdd a new "Embed" component and use the game URL: https://<game_type>.playgen.io/game/<publish_key>.
WebflowAdd an "Embed" element and insert the iFrame code provided above.
ShopifyAdd a "Custom HTML" section and insert the iFrame code provided above.
WeeblyAdd an "Embed Code" element and insert the iFrame code provided above.
JoomlaUse the {source} tags: {source}<iframe src="https://<game_type>.playgen.io/game/<publish_key>" width="100%" height="700" frameborder="0"></iframe>{/source}

Replace <publish_key> with your specific game publish key in all instances.

On this page