개요
이 가이드는 대시보드 구성부터 SDK 설치까지 사이트에 OneSignal 웹 푸시 알림을 추가하는 과정을 안내합니다. OneSignal은 Chrome, Firefox, Edge, Safari 및 기타 주요 브라우저를 지원합니다.요구 사항
- HTTPS 웹사이트: 웹 푸시는 HTTP 또는 시크릿/프라이빗 모드에서 작동하지 않습니다.
- 서버 액세스: Service Worker 파일을 사이트에 업로드해야 합니다.
- 단일 원본: 웹 푸시는 동일 원본 정책을 따릅니다. 여러 원본(도메인/하위 도메인)이 있는 경우 원본당 하나씩 여러 OneSignal 앱이 필요합니다. 이 브라우저 제한을 준수하려면 다음 중 하나를 수행할 수 있습니다:
- 구독을 위해 트래픽을 단일 원본으로 리디렉션합니다.
- 원본당 하나씩 여러 OneSignal 앱을 생성합니다.
팀이 이미 OneSignal로 계정을 만든 경우 앱을 설정할 수 있도록 관리자 역할로 초대받도록 요청하세요. 그렇지 않으면 onesignal.com에서 무료 계정에 가입하여 시작하세요!
OneSignal 앱 및 플랫폼 구성
OneSignal 대시보드에서:- 설정 > 푸시 및 인앱 > 웹으로 이동합니다.

일반 사이트(권장)
추가 코딩 없이 OneSignal 대시보드를 통해 직접 프롬프트 및 설정을 관리하세요.
WordPress
공식 플러그인으로 WordPress를 사용하는 경우 필요합니다.
사용자 지정 코드
프롬프트 및 SDK 구성에 대한 완전한 제어가 필요한 개발자를 위한 것입니다.
사이트 설정
사이트 세부 정보를 추가하세요:- 사이트 이름: 사이트 이름 및 기본 알림 제목입니다.
- 사이트 URL: 사이트의 URL입니다. 자세한 내용은 사이트 URL을 참조하세요.
- 자동 재구독: 사용자가 사이트로 돌아올 때 브라우저 데이터를 지운 사용자를 자동으로 재구독하려면 이것을 활성화하세요(새 권한 프롬프트 필요 없음)
- 기본 아이콘 URL: 알림 및 프롬프트에 표시되는 정사각형 256x256px PNG 또는 JPG 이미지를 업로드하세요. 설정하지 않으면 기본 아이콘으로 벨을 사용합니다.

사이트 URL
사이트의 정확한 원본을 입력하세요(예:https://yourdomain.com). 사이트가 그렇게 구성되지 않은 경우 www. 사용을 피하세요.
여러 원본이 있는 경우:
- 단일 원본으로 리디렉션합니다.
- 또는 원본당 하나의 OneSignal 앱을 설정합니다.
로컬 테스트
웹 SDK는 localhost 환경에서 테스트할 수 있습니다. localhost에서 테스트하는 경우 프로덕션 앱이 아닌 다른 OneSignal 앱을 설정하는 것이 좋습니다.Localhost 구성
Localhost 구성
사이트 URL을 localhost 환경 URL과 정확히 일치하도록 설정하세요. 일반적인 localhost URL이어야 합니다. 예:
OneSignal
localhost 사이트에서 OneSignal을 초기화할 때 OneSignal
http://localhosthttps://localhost:3000http://127.0.0.1https://127.0.0.1:5000
localhost가 HTTP를 사용하는 경우 테스트를 위해 HTTP localhost를 HTTPS로 처리를 선택하세요.Google Chrome은
http://localhost 및 http://127.0.0.1을 보안 원본으로 처리하여 HTTP에서도 HTTPS 통합을 허용합니다. 이것이 HTTPS localhost에서 다른 비표준 원본을 테스트할 수 없는 이유입니다.
OneSignal init 옵션에 allowLocalhostAsSecureOrigin 추가
localhost 사이트에서 OneSignal을 초기화할 때 OneSignal init 옵션에 allowLocalhostAsSecureOrigin: true,를 추가하세요.또한 자체 서명된 인증서로 HTTPS에서 localhost를 테스트하는 경우 Chrome이 테스트용 유효하지 않은 인증서를 무시하도록 요청해야 할 수 있습니다: --allow-insecure-localhost. Firefox 및 Safari는 보안 인증서에 대한 예외를 추가하는 기본 제공 메커니즘을 제공합니다.권한 프롬프트
일반적인 사이트 설정을 사용하면 사용자 또는 팀 구성원이 언제든지 OneSignal 대시보드를 통해 권한 프롬프트를 추가, 제거 및 업데이트할 수 있습니다.웹 권한 프롬프트
사용자에게 브라우저 권한 대화 상자가 표시되는 시기와 방법을 구성하세요.
환영 알림 (선택 사항)
사용자가 푸시 알림을 구독할 때 전송할 환영 알림을 설정할 수도 있습니다.고급 설정
OneSignal 대시보드에서 구성할 수 있는 추가 기능입니다.Webhooks
웹 SDK는 특정 웹 푸시 이벤트를 선택한 URL로POST할 수 있는 기능을 제공합니다.
웹 푸시 Webhook은 이벤트 Webhook과 별도의 구현이며 상호 교환하여 사용할 수 없습니다.
웹 푸시 웹훅
POST 요청을 통해 웹 푸시 이벤트를 서버로 전송하세요.
Service workers
웹 푸시 구성의 다음 페이지에서OneSignalSDKWorker.js service worker 파일이 제공됩니다.
웹 SDK는 기본적으로 사이트의 루트에서 이 파일을 찾습니다. service worker 파일 위치, 이름 및/또는 범위를 변경하려는 경우 여기에서 이러한 설정을 업데이트할 수 있습니다.
- Path to service worker files는 이러한 파일을 배치할 디렉토리의 경로입니다.
- Main and Updater service worker filenames는
OneSignalSDKWorker.js이거나 이 파일의 이름을 변경하려는 경우 사용할 수 있습니다..js파일 확장자를 사용해야 합니다. - Service worker registration scope는 이 파일이 작동할 수 있는 페이지입니다. 푸시 알림의 경우 이것은 중요하지 않으며 원래 service worker 파일에 더 많은 기능을 추가하려는 경우를 위해 설계되었습니다. 이것을 위치와 동일한 경로로 설정해야 합니다.

https://yourdomain.com/push/onesignal/OneSignalSDKWorker.js에서 파일의 코드를 공개적으로 액세스할 수 있어야 합니다.
OneSignal 서비스 워커
고급 서비스 워커 구성, 사용자 지정 통합 및 다른 제공업체에서의 마이그레이션.
클릭 동작
알림을 클릭할 때 설정한 URL로 사용자가 탐색하는 방법을 제어합니다. 사용자가 어떤 탭에도 사이트를 열지 않은 경우 브라우저는 새 탭을 열고 알림 URL로 이동합니다. 사용자가 이미 사이트를 열어둔 경우 동작은 선택한 설정에 따라 달라집니다:| 설정 | 일치 기준 | 동작 |
|---|---|---|
| Exact Navigate (기본값) | 정확한 URL (예: example.com/product) | 일치하는 탭에서 알림 URL로 이동 |
| Origin Navigate | 원본 (예: example.com) | 일치하는 탭에서 알림 URL로 이동 |
| Exact Focus | 정확한 URL | 새로 고침 없이 일치하는 탭에 포커스 |
| Origin Focus | 원본 | 새로 고침 없이 일치하는 탭에 포커스 |
지속성
기본 웹 푸시 동작은 장치에 약 5초 동안 팝업된 후 알림 센터로 이동되어 운영 체제에서 제거되기 전까지 약 1주일 동안 유지됩니다. 일부 장치 및 Chrome 및 Edge 버전에서는 화면에서 알림을 더 오래 유지할 수 있습니다. 이는 사용자가 상호 작용할 때까지 알림이 화면에 남아 있음을 의미합니다. 이것은 사용자를 짜증나게 할 수 있으며 권장되지 않습니다. 또한 지속성을 활성화하면 문자 수가 줄어들어 알림이 구독자에게 표시되는 방식에 영향을 미치고 이미지 및 버튼이 표시되는 방식에 영향을 줄 수 있습니다. 변경하면 업데이트된 설정으로 사이트를 방문하는 구독자에게만 적용됩니다. 이러한 옵션 변경이 표시되지 않으면 기다려야 합니다.Safari 인증서 (선택 사항)
OneSignal은 추가 비용 없이 Safari 브라우저에서 작동하는 데 필요한 인증서를 자동으로 제공합니다. 이미 자체 Safari 웹 푸시 인증서가 있는 경우 이 옵션을 켜서Safari Web .p12 Push Certificate 및 비밀번호를 업로드하세요.

Service worker 파일 업로드
사이트에OneSignalSDKWorker.js 서비스 워커 파일을 추가하세요. OneSignal 대시보드에서 다운로드하거나 GitHub에서 다운로드할 수 있습니다.

위치 확인
파일이 고급 설정 > Service workers에서 설정한 것과 동일한 Path to service worker files에 있는지 확인합니다. 이러한 설정을 업데이트하지 않은 경우 파일을 루트에 넣어야 합니다. 예를 들어:
https://yourdomain.com/OneSignalSDKWorker.jshttps://yourdomain.com/some-subdirectory/OneSignalSDKWorker.js
원본에서 공개적으로 액세스할 수 있어야 함
OneSignalSDKWorker.js 파일은 원본에서 공개적으로 액세스할 수 있고 사용 가능해야 합니다. CDN을 통해 호스팅되거나 리디렉션으로 다른 원본에 배치될 수 없습니다.파일의 URL을 방문하면 코드가 표시되어야 합니다.OneSignal 서비스 워커
고급 구성 및 다른 웹 푸시 제공업체에서의 마이그레이션.
사이트에 코드 추가
아래의 JavaScript SDK 코드는 모든 사이트에서 작동합니다. 사이트가 Angular, React JS 또는 Vue JS로 구축된 경우 해당 링크를 따르세요. JavaScript SDK로 사이트에서 OneSignal을 초기화하려면 제공된 코드를 웹사이트의<head> 태그에 복사/붙여넣기합니다. OneSignal 대시보드는 앱 ID가 미리 입력된 동일한 코드 스니펫을 제공합니다.
iOS 웹 푸시 지원
Apple은 iOS 16.4+를 실행하는 iPhone 및 iPad에서 웹 푸시 알림 지원을 시작했습니다. 지원되는 브라우저에서 방문하기만 하면 웹 푸시가 “작동”하는 Android 기기와 달리 Apple은manifest.json 파일 및 사용자가 홈 화면에 사이트를 추가하는 작업과 같은 몇 가지 요구 사항을 더 추가했습니다.
iOS 웹 푸시 설정
필수
manifest.json 파일을 추가하고 사용자가 홈 화면에 사이트를 추가하도록 안내합니다.FAQ
웹 푸시가 HTTP 사이트에서 작동하나요?
아니요. 웹 푸시는 HTTPS가 필요합니다. 브라우저는 이를 보안 요구 사항으로 적용합니다. 유일한 예외는localhost 및 127.0.0.1로, 브라우저가 개발 목적으로 보안 원본으로 처리합니다.
서비스 워커 파일이 왜 필요한가요?
서비스 워커는 백그라운드에서 실행되며 사용자가 사이트를 열지 않았을 때도 수신되는 푸시 알림을 처리합니다. 서비스 워커 없이는 브라우저가 알림을 표시할 수 없습니다.OneSignalSDKWorker.js 파일은 원본에서 공개적으로 액세스할 수 있어야 합니다.
iOS(iPhone/iPad)에서 웹 푸시를 사용할 수 있나요?
네, iOS 16.4+부터 가능합니다. 그러나 Apple은manifest.json 파일이 필요하며 사용자가 먼저 홈 화면에 사이트를 추가해야 합니다. 전체 요구 사항은 iOS 웹 푸시 설정을 참조하세요.
알림이 표시되지 않는 이유는 무엇인가요?
일반적인 원인으로는 잘못 배치된 서비스 워커 파일, 대시보드의 사이트 URL 불일치 또는 브라우저 설정에서 알림이 차단된 경우가 있습니다. 전체 문제 해결 체크리스트는 알림이 표시되지 않거나 지연됨을 참조하세요.Testing the OneSignal SDK integration
This guide helps you verify that your OneSignal SDK integration is working correctly by testing push notifications and subscription registration.Check web push subscriptions
Launch your site on a test device.
- Use Chrome, Firefox, Edge, or Safari while testing.
- Do not use Incognito or private browsing mode. Users cannot subscribe to push notifications in these modes.
- The prompts should appear based on your permission prompts configuration.
- Click Allow on the native prompt to subscribe to push notifications.

Check your OneSignal dashboard
- Go to Audience > Subscriptions.
- You should see a new entry with the status Subscribed.

You have successfully created a web push subscription.
Web push subscriptions are created when users first subscribe to push notifications on your site.
Set up test subscriptions
Test subscriptions are helpful for testing a push notification before sending a message.Add to Test Subscriptions.
In the dashboard, next to the subscription, click the Options (three dots) button and select Add to Test Subscriptions.

Name your subscription.
Name the subscription so you can easily identify your device later in the Test Subscriptions tab.
Name the segment.
Name the segment
Test Users (the name is important because it will be used later).Send test push via API
Get your App API Key and App ID.
In your OneSignal dashboard, go to Settings > Keys & IDs.
Update the provided code.
Replace
YOUR_APP_API_KEY and YOUR_APP_ID in the code below with your actual keys. This code uses the Test Users segment we created earlier.Check images and confirmed delivery.
If all setup steps were completed successfully, the test subscriptions should receive a notification.

Check for confirmed delivery.
In your dashboard, go to Delivery > Sent Messages, then click the message to view stats. You should see the confirmed stat, meaning the device received the push.
Safari does not support Confirmed Delivery.
푸시 알림 메시지 보고서
푸시 알림의 전달, 클릭 및 전환 통계를 확인하세요.
You have successfully sent a notification via the API to a segment.
support@onesignal.com with the following:
- The API request and response (copy-paste into a
.txtfile) - Your Subscription ID
- Your website URL with the OneSignal code
User identification
The previous section covered creating web push Subscriptions. This section expands to identifying Users across all their subscriptions (including push, email, and SMS) using the OneSignal SDK. It covers External IDs, tags, multi-channel subscriptions, privacy, and event tracking to help you unify and engage users across platforms.Assign External ID
Use an External ID to identify users consistently across devices, email addresses, and phone numbers using your backend’s user identifier. This ensures your messaging stays unified across channels and 3rd party systems (especially important for Integrations). Set the External ID with the SDK’slogin method each time a user is identified by your app.
OneSignal generates unique read-only IDs for subscriptions (Subscription ID) and users (OneSignal ID).As users download your app on different devices, subscribe to your website, and/or provide you email addresses and phone numbers outside of your app, new subscriptions will be created.Setting the External ID via the SDK is highly recommended to identify users across all their subscriptions, regardless of how they are created.
Add data tags
Tags are key-value pairs of string data you can use to store user properties (likeusername, role, or preferences) and events (like purchase_date, game_level, or user interactions). Tags power advanced Message Personalization and Segmentation allowing for more advanced use cases.
Set tags with the SDK’s addTag and addTags methods as events occur in your app.
In this example, the user reached level 6 identifiable by the tag called current_level set to a value of 6.



Add email and/or SMS subscriptions
The OneSignal SDK creates web push subscriptions automatically when users opt in. You can also reach users through email and SMS channels by creating the corresponding subscriptions.- Use the
addEmailmethod to create email subscriptions. - Use the
addSmsmethod to create SMS subscriptions.

Best practices for multi-channel communication
- Obtain explicit consent before adding email or SMS subscriptions.
- Explain the benefits of each communication channel to users.
- Provide channel preferences so users can select which channels they prefer.
Privacy & user consent
To control when OneSignal collects user data, use the SDK’s consent gating methods:setConsentRequired(true): Prevents data collection until consent is given.setConsentGiven(true): Enables data collection once consent is granted.
Listen to push, user, and in-app events
Use SDK listeners to react to user actions and state changes. The SDK provides several event listeners for you to hook into. See our SDK reference guide for more details.Push notification events
- Click event listener: Detect when a notification is tapped.
- Foreground lifecycle listener: Control how notifications behave in foreground.
User state changes
- User state change event listener: Detect when the External ID is set.
- Permission observer: Track the user’s specific interaction with the native push permission prompt.
- Push subscription change observer: Track when the push subscription status changes.
Advanced setup & capabilities
Explore more capabilities to enhance your integration:OneSignal로 마이그레이션
다른 푸시 공급자에서 OneSignal로 이전하세요.
통합
OneSignal을 서드파티 도구 및 플랫폼과 연결하세요.
액션 버튼
푸시 알림에 인터랙티브 버튼을 추가하세요.
다국어 메시징
사용자의 선호 언어로 현지화된 메시지를 전송하세요.
Identity Verification
서버 측 Identity Verification으로 SDK 통합을 보호하세요.
커스텀 아웃컴
메시지와 연결된 커스텀 전환 이벤트를 추적하세요.
Web SDK setup & reference
Congratulations! You’ve successfully completed the Web SDK setup guide.
도움이 필요하신가요?지원 팀과 채팅하거나
support@onesignal.com으로 이메일을 보내주세요.다음을 포함해 주세요:- 발생한 문제의 세부 정보 및 재현 단계(가능한 경우)
- OneSignal 앱 ID
- External ID 또는 Subscription ID(해당하는 경우)
- OneSignal 대시보드에서 테스트한 메시지의 URL(해당하는 경우)
- 관련 로그 또는 오류 메시지
