Skip to content

Commit 9d48600

Browse files
committed
2 parents 3c30c08 + cc50c32 commit 9d48600

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/hooks/useFlutterCommunication.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ import {
77
PermissionResult,
88
} from "@/utils/webViewCommunication";
99

10-
/// Flutter Webivew인지 userAgent를 통해 확인
11-
export const isFlutterWebView = /OneByOne/i.test(navigator.userAgent);
10+
/// Flutter InAppWebView 객체 존재 여부로 Flutter 환경 감지
11+
/// TODO 0806 한승완 : 추후 userAgent 변환 확인 필요
12+
export const isFlutterWebView = typeof window !== 'undefined' && !!window.flutter_inappwebview;
1213

1314
/**
1415
* FCM 토큰을 직접 요청하는 훅

src/services/locationService.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,10 @@ export async function requestLocationFromBrowser(
7575

7676
/**
7777
* 현재 환경이 Flutter WebView인지 확인
78+
* TODO 0806 한승완 : 추후 userAgent 변환 확인 필요
7879
*/
7980
export function isFlutterWebView(): boolean {
80-
return /OneByOne/i.test(navigator.userAgent);
81+
return typeof window !== 'undefined' && !!window.flutter_inappwebview;
8182
}
8283

8384
/**

0 commit comments

Comments
 (0)