> For the complete documentation index, see [llms.txt](https://developers-apps-in-toss.toss.im/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers-apps-in-toss.toss.im/documentation/common/screen/open-url.md).

# 외부 URL 열기

`openURL` 함수는 지정한 URL을 기기의 기본 브라우저나 연결된 앱에서 열 수 있게 해주는 유틸리티예요. 이 함수는 React Native의 [`Linking.openURL`](https://reactnative.dev/docs/0.72/linking#openurl)을 내부적으로 사용해요.

**시그니처**

```typescript
function openURL(url: string): Promise<any>;
```

**파라미터**

* **url** · 필수 · `string`

  열고자 하는 외부 웹 주소 또는 딥링크 경로예요.

**반환 값**

* `Promise<any>`

  URL이 성공적으로 열렸을 때 resolve되는 Promise를 반환해요.

**예제**

**외부 웹사이트 열기**

{% tabs %}
{% tab title="tsx\[React]" %}

```tsx[react]
import { openURL } from '@apps-in-toss/web-framework';

function Page() {
  const handlePress = () => {
    openURL('https://google.com');
  };

  return (
    <button onClick={handlePress}>
      구글 웹사이트 열기
    </button>
  );
}
```

{% endtab %}

{% tab title="React Native" %}

```tsx
import { openURL } from '@granite-js/react-native';
import { Button } from 'react-native';

function Page() {
  const handlePress = () => {
    openURL('https://google.com');
  };

  return <Button title="구글 웹사이트 열기" onPress={handlePress} />;
}
```

{% endtab %}
{% endtabs %}

**딥링크 열기**

{% tabs %}
{% tab title="tsx\[React]" %}

```tsx[react]
import { openURL } from '@apps-in-toss/web-framework';

openURL('intoss://{appName}');
```

{% endtab %}

{% tab title="React Native" %}

```tsx
import { openURL } from '@granite-js/react-native';

openURL('intoss://{appName}');
```

{% endtab %}
{% endtabs %}

### 참고사항

* 외부 URL을 열 수 없는 경우(잘못된 스킴, 네트워크 차단 등)에는 Promise가 reject될 수 있어요.
* WebView 환경에서는 브라우저 탭이 새로 열리며, 기본 앱에서는 외부 앱 또는 브라우저로 전환돼요.


---

# 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-apps-in-toss.toss.im/documentation/common/screen/open-url.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.
