[STEP4] Loading the Widget
In this section, we will explore how to load the widget using the URL generated in [STEP2] Setting Up the Widget and the authentication keys from [STEP3] Issuing and Utilizing WG Product Authentication Keys.
(1) Creating the URL
Select the widget path you want to load in the web view and append it to the widget domain https://ux-solution.waiker.ai
to create the URL.
Example: https://ux-solution.waiker.ai/insider-transaction
Widget | Page Name | Path |
---|---|---|
Insider Transaction | Home | /insider-transaction |
Search | /insider-transaction/search | |
Transaction Details | /insider-transaction/transaction/{id} | |
Stock Details | /insider-transaction/stock/{ticker} | |
Mini Stock Details (No Header, No AI Briefing) | /insider-transaction/stock-mini/{ticker} |
(2) Adding Product-Key and JWT Token to the URL Query String for Web View Execution
Example: https://ux-solution.waiker.ai/insider-transaction?product-key=YOUR_KEY&jwt=YOUR_JWT
Key | Required | Value Type | Default Value | Description |
---|---|---|---|---|
product-key | O | string | Null | Product key for widget access |
jwt | O | string | Null | JWT for widget access |
(3) Customizing Widget Styles
If you did not customize the widget in [STEP2] Setting Up the Widget, you can do so using the URL query string.
Example: https://ux-solution.waiker.ai/insider-transaction?product-key=YOUR_KEY&jwt=YOUR_JWT¤cy=USD&country=US&show-header=true
Key | Required | Value Type | Default Value | Description |
---|---|---|---|---|
anonym-id | X | string | Null | Unique user key (e.g., for favorite stocks) |
color-theme | X | 'dark' | 'light' | 'system' | 'light' | Dark mode option |
custom-style | X | 'default' | 'default' | Custom style per company |
currency | X | 'USD' | 'KRW' | 'KRW' | Currency type |
country | X | 'US' | 'KR' | 'US' | Country of the exchange |
language | X | 'en' | 'ko' | 'ko' | Language type |
show-header | X | boolean | 'true' | Whether to display the widget header |
show-buy-sell-button | X | boolean | 'false' | Whether to display buy/sell buttons |
Customization specific to certain pages is also available. Browse the list and select the desired options to add them to the URL query string.
Path | Key | Required | Value Type | Default Value | Description |
---|---|---|---|---|---|
news/{id} | news-ticker | X | string | Null | Focused stock setting |
news/{id} | news-country | X | 'US' | 'KR' | Null | Focused stock setting |
(4) Load the Completed URL in the Web View and Serve
Please check the example of integrating the web view below.
import android.os.Bundle
import android.webkit.WebView
import androidx.appcompat.app.AppCompatActivity
class MainActivity : AppCompatActivity() {
private lateinit var webView: WebView
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
webView = findViewById(R.id.webview)
webView.loadUrl("https://ux-solution.waiker.ai/insider-transaction?product-key=YOUR_KEY&jwt=YOUR_JWT")
}
}
import UIKit
import WebKit
class ViewController: UIViewController {
var webView: WKWebView!
override func loadView() {
webView = WKWebView()
webView.navigationDelegate = self
view = webView
}
override func viewDidLoad() {
super.viewDidLoad()
let url = URL(string: "https://ux-solution.waiker.ai/insider-transaction?product-key=abcde&jwt=abcde")!
webView.load(URLRequest(url: url))
}
}