Integrate Insider Transaction Widget
You can integrate Waiker’s widget in two simple steps
Copy the widget link
Integrate widget
Step 01
Copy the widget link
Screen Types
Select the widget screen you want to integrate
Widget Overview
A comprehensive screen featuring real-time transactions, AI analysis, and more
Stock Details
A screen showing the transaction status of a specific stock
Transaction Details
A screen analyzing all transactions made by insiders
UI Settings
Color Theme
Show Header
Show Buy/Sell Buttons
Data Settings
Country
Currency
Exclude Tickers
Step 02
Integrate widget
You can call JavaScript interfaces for specific actions within the widget to integrate with your app. The JavaScript interface name referenced by the widget is 'WaikerInterface'.
Interaction Options
![mts-connect](https://hub.waiker.ai/management/img/widget_guide_insider_main.png)
1
Back Navigation
Allows the user to return to the app from the initial widget screen
2
Share
Provides a button to share with others.
3
Jump to buy screen
Provides a button to jump to 'Buy' screen.
4
Jump to sell screen
Provides a button to jump to 'Sell' screen.
Function Name | Parameters | callbackReturn | Action descriptions |
---|---|---|---|
newWindow | url: string; | - | Open a new webview |
share | title?: string; text?: string; url: string; | - | Sharing action |
moveToBuy | ticker: string; | - | Go to stock purchase page |
moveToSell | ticker: string; | - | Go to stock sale page |
JS Interface Integration Example
1
2 webView.addJavascriptInterface(WebAppInterface(this), "WaikerInterface")
3
4class WebAppInterface(private val context: Context) {
5 @JavascriptInterface
6 fun close() {
7 // Logic to close the in-app webview that called this method
8 }
9 fun newWindow(url: String) {
10 // Logic to open a new in-app webview with the provided URL
11 }
12 // Implement the necessary logic from the list below
13}
14
1
2 webView.configuration.userContentController.add(
3 self,
4 name: "WaikerInterface"
5 )
6
7extension ViewController: WKScriptMessageHandler {
8 func userContentController(
9 _ userContentController: WKScriptMessage,
10 didReceive message: WKScriptMessage
11 ) {
12 if message.name == "WaikerInterface" {
13 if let body = message.body as? [String: Any] {
14 if let method = body["method"] as? String {
15 switch method {
16 case "close":
17 // Logic to close the in-app webview that called this method
18 break
19 case "newWindow":
20 if let url = body["url"] as? String {
21 // Logic to open a new in-app webview with the provided URL
22 }
23 break
24 // Implement the necessary logic from the list below
25 default:
26 break
27 }
28 }
29 }
30 }
31 }
32}