@vibexnpm/talkx 3.2.1 → 3.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibexnpm/talkx",
3
- "version": "3.2.1",
3
+ "version": "3.2.2",
4
4
  "type": "module",
5
5
  "description": "TalkFlow SDK - Chat & WebRTC unified client",
6
6
  "main": "dist/talkflow-sdk.umd.js",
@@ -411,9 +411,20 @@ class PushManager {
411
411
 
412
412
  // 알림 권한 요청
413
413
  // - 'default' 상태: 브라우저가 권한창을 표시하고 사용자 응답을 대기
414
- // - 'granted' 상태: 즉시 'granted' 반환 (창 안 뜸)
414
+ // - 'granted' 상태: 재요청하지 않고 즉시 통과 (아래 주의사항 참고)
415
415
  // - 'denied' 상태: 위 가드에서 이미 throw 했으므로 여기 도달 불가
416
- const permission = await Notification.requestPermission();
416
+ //
417
+ // !! Safari/WebKit 주의 !!
418
+ // Chromium 은 이미 granted 인 상태에서 requestPermission() 을 호출하면 창 없이 즉시
419
+ // 'granted' 를 반환하지만, Safari/WebKit 은 이 API 를 '사용자 제스처 안에서만' 허용한다.
420
+ // 따라서 연결 직후 자동 활성화처럼 제스처가 없는 경로에서는 이미 허용된 상태여도 거부로 반환되어
421
+ // PERMISSION_DENIED 로 throw 되고, 그 아래의 토큰 발급/서버 등록/포그라운드 onMessage 등록까지
422
+ // 모두 건너뛰게 된다(iOS 홈 화면 앱에서 새로고침마다 권한 차단 배너 + 포그라운드 메시지 미수신).
423
+ // 이미 허용된 상태에서는 재요청 자체가 불필요하므로 호출을 건너뛴다.
424
+ const permission =
425
+ Notification.permission === 'granted'
426
+ ? 'granted'
427
+ : await Notification.requestPermission();
417
428
  if (permission !== 'granted') {
418
429
  throw new PushError(
419
430
  PushErrorCode.PERMISSION_DENIED,