> For the complete documentation index, see [llms.txt](https://developers.fingerpush.com/segment/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.fingerpush.com/segment/sdk/webview.md).

# WebView에서 사용

## 자바스크립트 인터페이스 설정

앱 WebView에서 사용자 정보를 수신받기 위해 자바스크립트 인터페이스 설정을 합니다.

{% tabs %}
{% tab title="iOS" %}

```swift
let fingerWeb = fingerWebInterface()
fingerWeb.initInterface(with: WebView, jsLoad: true)
```

{% endtab %}

{% tab title="Android" %}

```kotlin
// WebView 자바스크립트 사용 설정
WebView.settings.javaScriptEnabled = true
// 자바스크립트 인터페이스 추가
WebView.addJavascriptInterface(FingerPushWebInterface(Context, WebView), FingerPushWebInterface.NAME)
// WebView Client 연결
WebView.webViewClient = FingerWebViewClient(Context)
```

{% endtab %}
{% endtabs %}

## 웹에서 앱으로 사용자 정보 전달

제공하는 자바스크립트 함수는 Android 및 Apple 네이티브 코드 모두와 호환되는 방법입니다.

다음 함수를 통해 사용자 정보 데이터를 전달할 수 있습니다.

<details>

<summary>FingerBridge.finger.sendUserSegment(String UserInfo)</summary>

{% code title="예제" %}

```javascript
// 사용자 정보
let userInfo = {
    name : "홍길동",
    gender : 0,
    age : 20,
    ...
};

let strJson = JSON.stringify(userInfo);
// 자바스크립트 인터페이스로 세그먼트 함수 호출
FingerBridge.finger.sendUserSegment(strJson);

```

{% endcode %}

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developers.fingerpush.com/segment/sdk/webview.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
