Getting Started
note
Embedding your community in an IFrame or Webview is available on all plans.
In many cases, you may want to embed your communinity or parts of it into your own product or phone app.
Embeddability is one of the core functionalities of Bettermode community platform alongside customizability and extensibility.
To embed a community in your web product, you can use <iframe>
tag. Here is an example of how it will look like:
<iframe
src="{{COMMUNITY_URL}}"
frameBorder="0"
width="100%">
</iframe>
On mobile apps, you can use WebView
to embed the community into your app:
- Swift
- Kotlin
- Java
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var webView: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
let url = NSURL (string: "{{COMMUNITY_URL}}");
let request = NSURLRequest(URL: url!);
webView.loadRequest(request);
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
// Add to your app layout
<WebView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
// To load the community URL
val myWebView: WebView = findViewById(R.id.webview)
myWebView.loadUrl("{{COMMUNITY_URL}}")
// Add to your app layout
<WebView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
// To load the community URL
WebView myWebView = (WebView) findViewById(R.id.webview);
myWebView.loadUrl("{{COMMUNITY_URL}}");
note
In the next sections, we're going to cover how you can generate your community URL to embed your entire Bettermode community, a specific space, or a particular post.