ba-cafe

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 42c1d805309193cec6d13fc8245c097f3071021b
parent 85d36e5d7ef09c24f9d1ba4dba924619aef84567
Author: Sunny <kajimalu10@gmail.com>
Date:   Mon, 20 Jul 2026 17:49:55 +0900

fix: update OneSignal service worker configuration and path

Diffstat:
Mnext.config.ts | 2+-
Msrc/components/OneSignalInit.tsx | 5+++--
2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/next.config.ts b/next.config.ts @@ -66,10 +66,10 @@ const withPWA = withPWAInit({ dest: "public", register: true, disable: process.env.NODE_ENV === "development", - publicExcludes: ["!OneSignalSDKWorker.js"], workboxOptions: { skipWaiting: true, clientsClaim: true, + importScripts: ["https://cdn.onesignal.com/sdks/web/v16/OneSignalSDK.sw.js"], }, }); diff --git a/src/components/OneSignalInit.tsx b/src/components/OneSignalInit.tsx @@ -10,8 +10,9 @@ export default function OneSignalInit() { await OneSignal.init({ appId: process.env.NEXT_PUBLIC_ONESIGNAL_APP_ID!, allowLocalhostAsSecureOrigin: true, - // サービスワーカーのパスをルートに固定して認識を安定させる - serviceWorkerPath: 'OneSignalSDKWorker.js', + // serviceWorkerPath: 'OneSignalSDKWorker.js', + serviceWorkerPath: "sw.js", + serviceWorkerParam: { scope: "/" }, welcomeNotification: { title: "Cafe Timer", message: "先生、通知設定が完了しました!",