Integrate Politician Transaction Widget

You can integrate Waiker’s widget in two simple steps

Step 01

Copy the widget link

Step 02

Integrate widget

Step 01

Copy the widget link

Screen Types

Select the widget screen you want to integrate

Widget Overview

A screen to view congressional returns, committee-related trades and more

Stock Details

A screen showing the transaction status of a specific stock

Transaction Details

A screen analyzing all transactions made by congress

UI Settings

Color Theme

Data Settings

Language

Currency

Product Key

JWT

Preview

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

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 sale screen

Provides a button to jump to 'Sale' screen.

4

Jump to purchase screen

Provides a button to jump to 'Purchase' screen.

Function Name

Parameters

callbackReturn

Action descriptions

newWindow

url: string;

-

Open a new webview

share

title?: string; text?: string; url: string;

-

Sharing action

moveToSell

ticker: string;

-

Go to stock purchase page

moveToBuy

ticker: string;

-

Go to stock details 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}

If you need assistance with integration, please contact us.

Developer center is accessible on desktop only

waiker-pc