From 58055882695d4f6ba149cba098510a9628d4955d Mon Sep 17 00:00:00 2001 From: A-KGeorge Date: Mon, 18 Nov 2024 13:53:12 -0330 Subject: [PATCH 01/15] docs updated --- docs/reference/react-sdk.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/reference/react-sdk.md b/docs/reference/react-sdk.md index f2461ce..2a4ca3b 100644 --- a/docs/reference/react-sdk.md +++ b/docs/reference/react-sdk.md @@ -508,6 +508,16 @@ notificationapi .then((result) => console.log(result)); ``` +## Web push + +Download notificationapi-service-worker.js and place it in the "public" folder of your web application. + +To request permission for notifications, place the following code inside an async function, and call that function when the user interacts with your application. + +```javascript +notificiationapi.setWebPushOptIn(true); +``` + From c301e0568284fcdcdc36ace84f4e92f5a302083a Mon Sep 17 00:00:00 2001 From: A-KGeorge Date: Thu, 21 Nov 2024 10:57:03 -0330 Subject: [PATCH 02/15] docs updated at setup web push and react sdk --- docs/guides/web-push.md | 49 ++++++++++++++++++++++++++++++++++++- docs/reference/react-sdk.md | 37 +++++++++++++++++++++++++--- 2 files changed, 82 insertions(+), 4 deletions(-) diff --git a/docs/guides/web-push.md b/docs/guides/web-push.md index c93db49..89ae64d 100644 --- a/docs/guides/web-push.md +++ b/docs/guides/web-push.md @@ -110,7 +110,44 @@ The service worker manages background tasks and is essential for receiving push 1. **Download** notificationapi-service-worker.js 2. **Place the file** in the `public` folder of your web application. It should be accessible at `https://yourdomain.com/notificationapi-service-worker.js`. -3. **Update the SDK Initialization**: If the service worker is not at the root, specify its path using the `customServiceWorkerPath` parameter during SDK initialization. +3. **Update the SDK Initialization**: If the service worker is not at the root, specify its path using the `customServiceWorkerPath` parameter during SDK initialization. For example, it is accessible at `https://yourdomain.com/service/notificationapi-service-worker.js`, please specify its path using the `customServiceWorkerPath` parameter during SDK initialization. + +Code examples for **step 3**: + + + +```JavaScript +const notificationapi = new NotificationAPI({ + clientId: 'YOUR_CLIENT_ID', + userId: 'UNIQUE_USER_ID', + customServiceWorkerPath: 'service/notificationapi-service-worker.js' +}); + +```` + + + + +```jsx + + {/* Your components */} + + +```` + + + **Step 4: Give permission on your browser** @@ -138,6 +175,16 @@ You can use the following method to ask your user to opt in for the web Push not notificationapi.askForWebPushPermission(); ``` +**Option 3: Using the react sdk** +If you are using our react SDK, you can use the following method to ask your user to opt. Place the code inside a component which is inside the `NotificationAPIProvider` provided by the React SDK. + +```jsx +const notificiationapi = NotificationAPIProvider.useNotificationAPIContext(); +const askForWebPushPermission = async () => { + notificiationapi.setWebPushOptIn(true); +}; +``` + **Step 5: Send Notifications from the Backend** With the frontend set up to receive notifications, you can now send them from your backend. diff --git a/docs/reference/react-sdk.md b/docs/reference/react-sdk.md index 2a4ca3b..17b019a 100644 --- a/docs/reference/react-sdk.md +++ b/docs/reference/react-sdk.md @@ -108,6 +108,31 @@ Change the deafult notification sound to include your own: +### Custom path to web push service worker + +The service worker must be placed in the public folder. + +The default path to the web push service worker is `/notificationapi-service-worker.js`, and is accessible at `https://yourdomain.com/notificationapi-service-worker.js` + +If the default path is not suitable for your application, you can change the path to the web push service worker. +The service worker should be accessible at the path you specify. + +For example, the web push service worker is placed at `public/service` folder and is accessible at `https://yourdomain.com/service/notificationapi-service-worker.js` + +```jsx + + + + + + +; +``` + ## In-App Notification Components ### Popup @@ -508,9 +533,7 @@ notificationapi .then((result) => console.log(result)); ``` -## Web push - -Download notificationapi-service-worker.js and place it in the "public" folder of your web application. +## setWebPushOptIn To request permission for notifications, place the following code inside an async function, and call that function when the user interacts with your application. @@ -518,6 +541,14 @@ To request permission for notifications, place the following code inside an asyn notificiationapi.setWebPushOptIn(true); ``` +## webPushOptInMessage + +This can be used to control the opt-in message for web push notifications. It can be set to either 'AUTOMATIC' or a boolean value. + +```javascript +notificationapi.webPushOptInMessage = 'AUTOMATIC'; +``` + From f4834e49c8980c01842bad1e470cd987ff6df95b Mon Sep 17 00:00:00 2001 From: A-KGeorge Date: Mon, 25 Nov 2024 15:47:23 -0330 Subject: [PATCH 03/15] included screenshots --- docs/guides/web-push.md | 10 ++++++++++ static/optInWebPush.png | Bin 0 -> 2843 bytes static/showPermissions.png | Bin 0 -> 7237 bytes 3 files changed, 10 insertions(+) create mode 100644 static/optInWebPush.png create mode 100644 static/showPermissions.png diff --git a/docs/guides/web-push.md b/docs/guides/web-push.md index 89ae64d..af414ba 100644 --- a/docs/guides/web-push.md +++ b/docs/guides/web-push.md @@ -6,6 +6,8 @@ import windowsNotifications from '@site/static/windowsNotifications.png'; import notificationPopup from '@site/static/notificationPopup.png'; import notificationPreferences from '@site/static/notificationPreferences.png'; import webConsoleServiceWorker from '@site/static/webConsoleServiceWorker.png'; +import optInWebPush from '@site/static/optInWebPush.png' +import showPermissions from '@site/static/showPermissions.png' Web Push Notifications allow you to engage users directly through their web browsers, even when they're not on your website. This guide will walk you through setting up Web Push Notifications using NotificationAPI. @@ -185,6 +187,14 @@ const askForWebPushPermission = async () => { }; ``` +In the screenshot below, the user has placed the above code inside a react component and called the askForWebPushPermission when the user has pressed the button. This would prompt the browser to request permission to show notifications. The component has been placed inside the `NotificationAPIProvider` provided by the React SDK. + + + +
+ + + **Step 5: Send Notifications from the Backend** With the frontend set up to receive notifications, you can now send them from your backend. diff --git a/static/optInWebPush.png b/static/optInWebPush.png new file mode 100644 index 0000000000000000000000000000000000000000..e7f35487ac366be3e28914ce33b01186deba995f GIT binary patch literal 2843 zcmbtWX*3iJ7oNykLyYaUjkPRego?=)S+h%H$UZaHn3}~HvM+_+6l2gJ@kTX-!6am< zL>M7!w#X96P8jK%@89?HJ?FdU-22>n&U4Rs?vH!Ulj>-13FMdL2LJ#-Yb!HnHd5GW z%gfEK8UNVR*l-+YYVE?yj@!JbyX^Tdyg34Y72}U5`eM<5fG|ubS_6l~qS0ZvKn#A3 zv&D!_()cgwG8XNN55k1Wxderx0e0+0`@EbzCR|SYtoAv%vpN@bv@dFD$vN7|*_f8W<<^q}O7@E?=;tKs zD7o&EGxJMAQTAWVYtl(1JyI7vE3<6S(JBLeC80R3(|qfZdx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hb^-7MR<0<6vL&0d=NB>V@Z Cnozs| literal 0 HcmV?d00001 diff --git a/static/showPermissions.png b/static/showPermissions.png new file mode 100644 index 0000000000000000000000000000000000000000..934bd811647c12dc92c1da0eeeda5c8f5f9bd7bb GIT binary patch literal 7237 zcmcI}WmH^2uqFW#EI0}7!GddoOOW910RjXG?h=>*f;+)23>nGj#wg+cGLvkjX1qaYy6pyBGnAiyUe#K0#gCL|=rC&Zwo&Y+>I zH&WS?iH1g3%r&RZcm3$^J}*!{)uLjwq|qvReh1%of*?Xcv2r z*jr`@j|q26Td9JFI0z$wnLscpR@4&&GC z|5P*~ip-_DgSHrhu0>CW%4#;G!ikU^QSS)8?2$~LC&(4GHlxVo8bSF4qKskK_4M9BQci?M)A4==gPDdO~g+X(nneoLp@#(|q#N=oNeO6i8->Tq8<(chP@V z`2bE`rHIeNHh*-Hblqn)kF0xu!oLe<0yJOWba(9oLZ3BJebC?>#`7?`ICSt(rS2Ih zw}p-`FP?fpKx+~&Z*M-==LXLYY_k>fe{TJ@Hthg?Tx=$Ao_FHoJ4@AoWjPQUmE^u| ziJ-q1?hUn`mgVq=B*@LBVM@TtaE4Pj(G%j@qy{pw&0Gp4=}=;P7AXA@RopY${64o> z;_k5u*UCMmF$V6|lMy&P>G_NN`Bn~|g?IP&OVg9DQBa%YkDdZf03?T zNI174=G@mQ4Z;QgBH**?Jhgne2ll)9*1~USCMDtsB)GQ0-_X&Oi>B7v%e-BZ%Tw33 zZrM(57$+b$@xstsZ@sw}S!4?y8i?!R+1`+K_#lF}^HuQIc+|cjp*5A&Iub5D{45sp zI}t6*N5F`D?9@It+xbHowcYQ_pwI;{yvkHji--{IXjCZE^VnXBb(ShE}rWzG9y zOVXxURZ$a41YUi5n4QaG&@_EUC?(aQWfV)8pP(eEA_W;aP8_c$QCqC>mA#P|HSp zbAyxnOP1=lGZsdW9nJK=GuHciVAH1A4BazD7-{M2AA22&ApI=<3}{RA?C2JooL6e_ znpxA)Lc-wF_HCg}sCyy7e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00 2001 From: A-KGeorge Date: Mon, 25 Nov 2024 15:48:42 -0330 Subject: [PATCH 04/15] modified description --- docs/guides/web-push.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/web-push.md b/docs/guides/web-push.md index af414ba..89a7fc2 100644 --- a/docs/guides/web-push.md +++ b/docs/guides/web-push.md @@ -187,7 +187,7 @@ const askForWebPushPermission = async () => { }; ``` -In the screenshot below, the user has placed the above code inside a react component and called the askForWebPushPermission when the user has pressed the button. This would prompt the browser to request permission to show notifications. The component has been placed inside the `NotificationAPIProvider` provided by the React SDK. +In the screenshot below, the user has placed the above code inside a react component and called the `askForWebPushPermission` function when the user has pressed the button. This would prompt the browser to request permission to show notifications. The component has been placed inside the `NotificationAPIProvider` provided by the React SDK. From 7b7c2bfdcbaa1e7aa5a923504bda0a352ed26f28 Mon Sep 17 00:00:00 2001 From: A-KGeorge Date: Tue, 26 Nov 2024 14:03:37 -0330 Subject: [PATCH 05/15] Add separate tabs --- docs/guides/web-push.md | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/docs/guides/web-push.md b/docs/guides/web-push.md index 89a7fc2..4bff5dd 100644 --- a/docs/guides/web-push.md +++ b/docs/guides/web-push.md @@ -46,7 +46,7 @@ import TabItem from '@theme/TabItem'; groupId="package-manager" defaultValue="manager" values={[ -{ label: 'Package Manager', value: 'manager' }, +{ label: 'Vanilla JS', value: 'manager' }, { label: 'UMD', value: 'umd' } ] }> @@ -116,6 +116,7 @@ The service worker manages background tasks and is essential for receiving push Code examples for **step 3**: -```JavaScript +```js const notificationapi = new NotificationAPI({ clientId: 'YOUR_CLIENT_ID', userId: 'UNIQUE_USER_ID', @@ -153,6 +154,18 @@ const notificationapi = new NotificationAPI({ **Step 4: Give permission on your browser** + + + + **Option 1: Rely on NotificationAPI Pre-Built component (Recommended)** If you are using our front-end SDK to show in-app notifications. You can simply rely on our SDK to ask your users to opt in for web push notification. @@ -177,7 +190,10 @@ You can use the following method to ask your user to opt in for the web Push not notificationapi.askForWebPushPermission(); ``` -**Option 3: Using the react sdk** + + + + If you are using our react SDK, you can use the following method to ask your user to opt. Place the code inside a component which is inside the `NotificationAPIProvider` provided by the React SDK. ```jsx @@ -195,6 +211,9 @@ In the screenshot below, the user has placed the above code inside a react compo + + + **Step 5: Send Notifications from the Backend** With the frontend set up to receive notifications, you can now send them from your backend. From 55e87f2b209a22d7d87c20b837d9bd7caf5008aa Mon Sep 17 00:00:00 2001 From: A-KGeorge Date: Tue, 26 Nov 2024 14:04:17 -0330 Subject: [PATCH 06/15] fixed a typo --- docs/guides/web-push.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guides/web-push.md b/docs/guides/web-push.md index 4bff5dd..3c6b8e2 100644 --- a/docs/guides/web-push.md +++ b/docs/guides/web-push.md @@ -205,11 +205,11 @@ const askForWebPushPermission = async () => { In the screenshot below, the user has placed the above code inside a react component and called the `askForWebPushPermission` function when the user has pressed the button. This would prompt the browser to request permission to show notifications. The component has been placed inside the `NotificationAPIProvider` provided by the React SDK. - +
- +
From 3f686542bbdbd35784e873629ccfc7b72879b903 Mon Sep 17 00:00:00 2001 From: A-KGeorge Date: Tue, 26 Nov 2024 14:38:39 -0330 Subject: [PATCH 07/15] Added react to web push install --- docs/guides/web-push.md | 82 +++++++++++++++++++++++++++++++++++------ 1 file changed, 70 insertions(+), 12 deletions(-) diff --git a/docs/guides/web-push.md b/docs/guides/web-push.md index 3c6b8e2..fb66049 100644 --- a/docs/guides/web-push.md +++ b/docs/guides/web-push.md @@ -43,14 +43,15 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; - + ```shell title="1. Install" npm install notificationapi-js-client-sdk @@ -70,7 +71,67 @@ const notificationapi = new NotificationAPI({ }); ``` +#### Parameters + +| Parameter | Type | Description | +| ----------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------ | +| clientId\* | string | Your NotificationAPI account clientId. You can get it from [here](https://app.notificationapi.com/environments). | +| userId\* | string | The unique ID of the user in your system. | +| userIdHash | string | Only used for [Secure Mode](/guides/secure-mode). | +| websocket | string | Only if you want to specify your region, for example, if your account is in Canada region you must pass 'wss://ws.ca.notificationapi.com'. | +| language | string | The language used for the pre-built UI widgets. Supported: `en-US`, `es-ES`, `fr-FR`, `it-IT`, `pt-BR` | +| customServiceWorkerPath | string | Path to your service worker file if it's not at the root (e.g., '/custom/path/notificationapi-service-worker.js'). | + +\* Required parameters + +For more information please checkout our [vanilla JS SDK](/reference/js-client#setup--initialization) guid. + + + + +```shell title="1. Install" +npm install @notificationapi/react --legacy-peer-deps +# or +# yarn add @notificationapi/react +# or +# pnpm add @notificationapi/react +```` + +```jsx title="2. Import and use our provider in your top-level components/routers." +import { NotificationAPIProvider } from '@notificationapi/react'; + + + + + + + +; +``` + +#### Parameters + +| Parameter | Type | Description | +| ----------------------- | ------ | ------------------------------------------------------------------------------------------------------------------ | +| clientId\* | string | Your NotificationAPI account clientId. You can get it from [here](https://app.notificationapi.com/environments). | +| userId\* | string | The unique ID of the user in your system. | +| hashedUserId | string | Only used for [Secure Mode](/guides/secure-mode). | +| customServiceWorkerPath | string | Path to your service worker file if it's not at the root (e.g., '/custom/path/notificationapi-service-worker.js'). | + +\* Required parameters + +For more information please checkout our [React SDK](/reference/react-sdk#setup) guid. + + ```html title="1. Add to HTML, before " @@ -88,9 +149,6 @@ const notificationapi = new NotificationAPI({ }); ``` - - - #### Parameters | Parameter | Type | Description | @@ -106,6 +164,9 @@ const notificationapi = new NotificationAPI({ For more information please checkout our [vanilla JS SDK](/reference/js-client#setup--initialization) guid. + +
+ **Step 3: Service Worker Setup** The service worker manages background tasks and is essential for receiving push notifications. @@ -132,9 +193,7 @@ const notificationapi = new NotificationAPI({ userId: 'UNIQUE_USER_ID', customServiceWorkerPath: 'service/notificationapi-service-worker.js' }); - -```` - +``` @@ -146,8 +205,7 @@ const notificationapi = new NotificationAPI({ > {/* Your components */} - -```` +``` From 63dc02fe619da299edd4765263bd86c8176614a1 Mon Sep 17 00:00:00 2001 From: A-KGeorge Date: Tue, 26 Nov 2024 15:40:14 -0330 Subject: [PATCH 08/15] added screenshots --- docs/guides/web-push.md | 39 +++++++++++-------- static/notificationPreferencesPopupReact.png | Bin 0 -> 15585 bytes static/notificationPreferencesReact.png | Bin 0 -> 8276 bytes static/optInWebPush.png | Bin 2843 -> 0 bytes static/showPermissions.png | Bin 7237 -> 0 bytes 5 files changed, 22 insertions(+), 17 deletions(-) create mode 100644 static/notificationPreferencesPopupReact.png create mode 100644 static/notificationPreferencesReact.png delete mode 100644 static/optInWebPush.png delete mode 100644 static/showPermissions.png diff --git a/docs/guides/web-push.md b/docs/guides/web-push.md index fb66049..9cd3ff3 100644 --- a/docs/guides/web-push.md +++ b/docs/guides/web-push.md @@ -6,8 +6,9 @@ import windowsNotifications from '@site/static/windowsNotifications.png'; import notificationPopup from '@site/static/notificationPopup.png'; import notificationPreferences from '@site/static/notificationPreferences.png'; import webConsoleServiceWorker from '@site/static/webConsoleServiceWorker.png'; -import optInWebPush from '@site/static/optInWebPush.png' -import showPermissions from '@site/static/showPermissions.png' +import notificationPreferencesReact from '@site/static/notificationPreferencesReact.png' + +import notificationPreferencesPopupReact from '@site/static/notificationPreferencesPopupReact.png' Web Push Notifications allow you to engage users directly through their web browsers, even when they're not on your website. This guide will walk you through setting up Web Push Notifications using NotificationAPI. @@ -84,7 +85,7 @@ const notificationapi = new NotificationAPI({ \* Required parameters -For more information please checkout our [vanilla JS SDK](/reference/js-client#setup--initialization) guid. +For more information please checkout our [vanilla JS SDK](/reference/js-client#setup--initialization) guide. @@ -110,9 +111,7 @@ import { NotificationAPIProvider } from '@notificationapi/react'; // }} playSoundOnNewNotification={true} // Allow the user to hear default sound on new notification > - - - + {/* your protected routes */} ; ``` @@ -128,7 +127,7 @@ import { NotificationAPIProvider } from '@notificationapi/react'; \* Required parameters -For more information please checkout our [React SDK](/reference/react-sdk#setup) guid. +For more information please checkout our [React SDK](/reference/react-sdk#setup) guide. @@ -162,7 +161,7 @@ const notificationapi = new NotificationAPI({ \* Required parameters -For more information please checkout our [vanilla JS SDK](/reference/js-client#setup--initialization) guid. +For more information please checkout our [vanilla JS SDK](/reference/js-client#setup--initialization) guide. @@ -252,7 +251,21 @@ notificationapi.askForWebPushPermission(); -If you are using our react SDK, you can use the following method to ask your user to opt. Place the code inside a component which is inside the `NotificationAPIProvider` provided by the React SDK. +**Option 1: Rely on NotificationAPI Pre-Built component (Recommended)** If you are using our react SDK to show in-app notifications. You can simply rely on our SDK to ask your users to opt in for web push notification. + +1. Place the `` component inside the `NotificationAPIProvider` component. For more information on the component please checkout our [React SDK](/reference/react-sdk#popup) guide. + + + +2. Click on Notification Preferences. This would open up a popup. + + + +3. Click on Yes. + +This would prompt the browser to ask for permission to show notifications. Alternatively, you can place the `` component inside the `NotificationAPIProvider` component. For more information on the component please checkout our [React SDK](/reference/react-sdk#preferences-popup) guide. + +**Option 2: Using built-in method** You can place the code inside a component which is inside the `NotificationAPIProvider` provided by the React SDK and call the `askForWebPushPermission` function when the user interacts with your application. ```jsx const notificiationapi = NotificationAPIProvider.useNotificationAPIContext(); @@ -261,14 +274,6 @@ const askForWebPushPermission = async () => { }; ``` -In the screenshot below, the user has placed the above code inside a react component and called the `askForWebPushPermission` function when the user has pressed the button. This would prompt the browser to request permission to show notifications. The component has been placed inside the `NotificationAPIProvider` provided by the React SDK. - - - -
- - -
diff --git a/static/notificationPreferencesPopupReact.png b/static/notificationPreferencesPopupReact.png new file mode 100644 index 0000000000000000000000000000000000000000..08dacff00a0bfe1ac886ff03e8da0b57d0064c1b GIT binary patch literal 15585 zcmb_@c{r8**Y8FsiA08sMMN@|A+uCMDDyl|ndf;9iO3MilqAVK&m@_r3}M^YWJ+w? zka;?5Kfm|A&L8h}-gAEEoaefpD|_$zzQ5C2pY{2yweCn&<%btYu8<%QhzpP8<(?uC z_=E@q9^qLc_{P;O@iqK&##Q!_`dRqT@2vR?_)O<^U)xR1(b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kemBUR_Vr-tNUF5}e=1JWEvPRE4S zaB%VP?zoHhE^aAkXqY43gncEh(h&Ij6Bv^>n2FJkMLlSMQ3q^mh};=y#XN2zhfn6~ zL%Sc3oC#C&57%ED3wyqs4N<7Uv z0H6cR{V!9i{$w7SlF7$%&`tftdiJq(!Q}nGTzExVwXDM8T33!3joHexsOO=Imxryv zy@)1!Q`U*hUZ{KG6;ZMfdzaetQ1E1r`8_`(lpgz~WpQSug?dM3nUDeUSz6gbPB-u$LqwMZNch8udC z3XTFqh|bwDc`@aK28NJ1Pr+m;eTr`k%BVFLm9C2!)CCCcmu{fo_IH z49vvUTa}UAFaRtqC@hnLt3a=i2#NlqWT&f{8CYL1SLkbmD7;Q0aXqv;{Dq7QUNiIy zGxjit5imlL3T6oV#Euky&7c;8#KoYfl>cKfISBhTIM=X*5q#5RbOMMZF>$tSg_43^ z^HLR8s=Q{9`J99t!0RM6WU7$>R7~>U2ng6^kv;vtVBJ3Ry?zrjiy2Ih%=n|o%PPs# IfJ{RE2WCb-^8f$< literal 0 HcmV?d00001 diff --git a/static/optInWebPush.png b/static/optInWebPush.png deleted file mode 100644 index e7f35487ac366be3e28914ce33b01186deba995f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2843 zcmbtWX*3iJ7oNykLyYaUjkPRego?=)S+h%H$UZaHn3}~HvM+_+6l2gJ@kTX-!6am< zL>M7!w#X96P8jK%@89?HJ?FdU-22>n&U4Rs?vH!Ulj>-13FMdL2LJ#-Yb!HnHd5GW z%gfEK8UNVR*l-+YYVE?yj@!JbyX^Tdyg34Y72}U5`eM<5fG|ubS_6l~qS0ZvKn#A3 zv&D!_()cgwG8XNN55k1Wxderx0e0+0`@EbzCR|SYtoAv%vpN@bv@dFD$vN7|*_f8W<<^q}O7@E?=;tKs zD7o&EGxJMAQTAWVYtl(1JyI7vE3<6S(JBLeC80R3(|qfZdxxpWm~wJ5Vezod+=gk> z!?7Dv7$931pGTS=`^{uE>uf2grWMQaGH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showPermissions.png deleted file mode 100644 index 934bd811647c12dc92c1da0eeeda5c8f5f9bd7bb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7237 zcmcI}WmH^2uqFW#EI0}7!GddoOOW910RjXG?h=>*f;+)23>nGj#wg+cGLvkjX1qaYy6pyBGnAiyUe#K0#gCL|=rC&Zwo&Y+>I zH&WS?iH1g3%r&RZcm3$^J}*!{)uLjwq|qvReh1%of*?Xcv2r z*jr`@j|q26Td9JFI0z$wnLscpR@4&&GC z|5P*~ip-_DgSHrhu0>CW%4#;G!ikU^QSS)8?2$~LC&(4GHlxVo8bSF4qKskK_4M9BQci?M)A4==gPDdO~g+X(nneoLp@#(|q#N=oNeO6i8->Tq8<(chP@V z`2bE`rHIeNHh*-Hblqn)kF0xu!oLe<0yJOWba(9oLZ3BJebC?>#`7?`ICSt(rS2Ih zw}p-`FP?fpKx+~&Z*M-==LXLYY_k>fe{TJ@Hthg?Tx=$Ao_FHoJ4@AoWjPQUmE^u| ziJ-q1?hUn`mgVq=B*@LBVM@TtaE4Pj(G%j@qy{pw&0Gp4=}=;P7AXA@RopY${64o> z;_k5u*UCMmF$V6|lMy&P>G_NN`Bn~|g?IP&OVg9DQBa%YkDdZf03?T zNI174=G@mQ4Z;QgBH**?Jhgne2ll)9*1~USCMDtsB)GQ0-_X&Oi>B7v%e-BZ%Tw33 zZrM(57$+b$@xstsZ@sw}S!4?y8i?!R+1`+K_#lF}^HuQIc+|cjp*5A&Iub5D{45sp zI}t6*N5F`D?9@It+xbHowcYQ_pwI;{yvkHji--{IXjCZE^VnXBb(ShE}rWzG9y zOVXxURZ$a41YUi5n4QaG&@_EUC?(aQWfV)8pP(eEA_W;aP8_c$QCqC>mA#P|HSp zbAyxnOP1=lGZsdW9nJK=GuHciVAH1A4BazD7-{M2AA22&ApI=<3}{RA?C2JooL6e_ znpxA)Lc-wF_HCg}sCyy7e&j)iXtOL8g-;>?W3hRHD+jgeuy0o>K`b zUP8=j6Ik%bla6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a typo --- docs/guides/web-push.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/web-push.md b/docs/guides/web-push.md index 9cd3ff3..d4fc706 100644 --- a/docs/guides/web-push.md +++ b/docs/guides/web-push.md @@ -257,7 +257,7 @@ notificationapi.askForWebPushPermission(); -2. Click on Notification Preferences. This would open up a popup. +2. Click on Notification Preferences. This would open a popup. From 4996e01347ed68628ce63a2ac553c23cc4680dbd Mon Sep 17 00:00:00 2001 From: A-KGeorge Date: Fri, 29 Nov 2024 13:06:51 -0330 Subject: [PATCH 10/15] web push updated --- docs/guides/web-push.md | 168 ++++++++++++++++++------------------ docs/reference/react-sdk.md | 24 +++++- 2 files changed, 105 insertions(+), 87 deletions(-) diff --git a/docs/guides/web-push.md b/docs/guides/web-push.md index d4fc706..b8116cf 100644 --- a/docs/guides/web-push.md +++ b/docs/guides/web-push.md @@ -7,7 +7,6 @@ import notificationPopup from '@site/static/notificationPopup.png'; import notificationPreferences from '@site/static/notificationPreferences.png'; import webConsoleServiceWorker from '@site/static/webConsoleServiceWorker.png'; import notificationPreferencesReact from '@site/static/notificationPreferencesReact.png' - import notificationPreferencesPopupReact from '@site/static/notificationPreferencesPopupReact.png' Web Push Notifications allow you to engage users directly through their web browsers, even when they're not on your website. This guide will walk you through setting up Web Push Notifications using NotificationAPI. @@ -45,49 +44,13 @@ import TabItem from '@theme/TabItem'; - - -```shell title="1. Install" -npm install notificationapi-js-client-sdk -# yarn add notificationapi-js-client-sdk -# pnpm add notificationapi-js-client-sdk -``` - -```js title="2. Import" -import NotificationAPI from 'notificationapi-js-client-sdk'; -import 'notificationapi-js-client-sdk/dist/styles.css'; -``` - -```js title="3. Initialize" -const notificationapi = new NotificationAPI({ - clientId: 'YOUR_CLIENT_ID', - userId: 'UNIQUE_USER_ID' -}); -``` - -#### Parameters - -| Parameter | Type | Description | -| ----------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------ | -| clientId\* | string | Your NotificationAPI account clientId. You can get it from [here](https://app.notificationapi.com/environments). | -| userId\* | string | The unique ID of the user in your system. | -| userIdHash | string | Only used for [Secure Mode](/guides/secure-mode). | -| websocket | string | Only if you want to specify your region, for example, if your account is in Canada region you must pass 'wss://ws.ca.notificationapi.com'. | -| language | string | The language used for the pre-built UI widgets. Supported: `en-US`, `es-ES`, `fr-FR`, `it-IT`, `pt-BR` | -| customServiceWorkerPath | string | Path to your service worker file if it's not at the root (e.g., '/custom/path/notificationapi-service-worker.js'). | - -\* Required parameters - -For more information please checkout our [vanilla JS SDK](/reference/js-client#setup--initialization) guide. - - ```shell title="1. Install" @@ -109,7 +72,6 @@ import { NotificationAPIProvider } from '@notificationapi/react'; // user={{ // id: "abcd-1234", // logged in userId // }} - playSoundOnNewNotification={true} // Allow the user to hear default sound on new notification > {/* your protected routes */} @@ -131,6 +93,43 @@ For more information please checkout our [React SDK](/reference/react-sdk#setup) + + +```shell title="1. Install" +npm install notificationapi-js-client-sdk +# yarn add notificationapi-js-client-sdk +# pnpm add notificationapi-js-client-sdk +``` + +```js title="2. Import" +import NotificationAPI from 'notificationapi-js-client-sdk'; +import 'notificationapi-js-client-sdk/dist/styles.css'; +``` + +```js title="3. Initialize" +const notificationapi = new NotificationAPI({ + clientId: 'YOUR_CLIENT_ID', + userId: 'UNIQUE_USER_ID' +}); +``` + +#### Parameters + +| Parameter | Type | Description | +| ----------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------ | +| clientId\* | string | Your NotificationAPI account clientId. You can get it from [here](https://app.notificationapi.com/environments). | +| userId\* | string | The unique ID of the user in your system. | +| userIdHash | string | Only used for [Secure Mode](/guides/secure-mode). | +| websocket | string | Only if you want to specify your region, for example, if your account is in Canada region you must pass 'wss://ws.ca.notificationapi.com'. | +| language | string | The language used for the pre-built UI widgets. Supported: `en-US`, `es-ES`, `fr-FR`, `it-IT`, `pt-BR` | +| customServiceWorkerPath | string | Path to your service worker file if it's not at the root (e.g., '/custom/path/notificationapi-service-worker.js'). | + +\* Required parameters + +For more information please checkout our [vanilla JS SDK](/reference/js-client#setup--initialization) guide. + + + ```html title="1. Add to HTML, before " @@ -177,13 +176,25 @@ The service worker manages background tasks and is essential for receiving push Code examples for **step 3**: + +```jsx + + {/* Your components */} + +``` + + ```js @@ -195,32 +206,47 @@ const notificationapi = new NotificationAPI({ ``` - -```jsx - - {/* Your components */} - -``` - - **Step 4: Give permission on your browser** + + +**Option 1: Rely on NotificationAPI Pre-Built component (Recommended)** If you are using our react SDK to show in-app notifications. You can simply rely on our SDK to ask your users to opt in for web push notification. + +1. Place the `` component inside the `NotificationAPIProvider` component. For more information on the component please checkout our [React SDK](/reference/react-sdk#popup) guide. + + + +2. Click on Notification Preferences. This would open a popup. + + + +3. Click on Yes. + +This would prompt the browser to ask for permission to show notifications. Alternatively, you can place the `` component inside the `NotificationAPIProvider` component. For more information on the component please checkout our [React SDK](/reference/react-sdk#preferences-popup) guide. + +**Option 2: Using built-in method** You can place the code inside a component which is inside the `NotificationAPIProvider` provided by the React SDK and call the `askForWebPushPermission` function when the user interacts with your application. + +```jsx +const notificiationapi = NotificationAPIProvider.useNotificationAPIContext(); +const askForWebPushPermission = async () => { + notificiationapi.setWebPushOptIn(true); +}; +``` + + + **Option 1: Rely on NotificationAPI Pre-Built component (Recommended)** @@ -249,32 +275,6 @@ notificationapi.askForWebPushPermission(); - - -**Option 1: Rely on NotificationAPI Pre-Built component (Recommended)** If you are using our react SDK to show in-app notifications. You can simply rely on our SDK to ask your users to opt in for web push notification. - -1. Place the `` component inside the `NotificationAPIProvider` component. For more information on the component please checkout our [React SDK](/reference/react-sdk#popup) guide. - - - -2. Click on Notification Preferences. This would open a popup. - - - -3. Click on Yes. - -This would prompt the browser to ask for permission to show notifications. Alternatively, you can place the `` component inside the `NotificationAPIProvider` component. For more information on the component please checkout our [React SDK](/reference/react-sdk#preferences-popup) guide. - -**Option 2: Using built-in method** You can place the code inside a component which is inside the `NotificationAPIProvider` provided by the React SDK and call the `askForWebPushPermission` function when the user interacts with your application. - -```jsx -const notificiationapi = NotificationAPIProvider.useNotificationAPIContext(); -const askForWebPushPermission = async () => { - notificiationapi.setWebPushOptIn(true); -}; -``` - - **Step 5: Send Notifications from the Backend** diff --git a/docs/reference/react-sdk.md b/docs/reference/react-sdk.md index 17b019a..f567dd1 100644 --- a/docs/reference/react-sdk.md +++ b/docs/reference/react-sdk.md @@ -133,6 +133,24 @@ For example, the web push service worker is placed at `public/service` folder an ; ``` +### webPushOptInMessage + +The `webPushOptInMessage` controls whether the browser automatically prompts users for notification permissions (true or 'AUTOMATIC') or suppresses the prompt (false). + +```jsx + + + + + + +; +``` + ## In-App Notification Components ### Popup @@ -541,12 +559,12 @@ To request permission for notifications, place the following code inside an asyn notificiationapi.setWebPushOptIn(true); ``` -## webPushOptInMessage +## setWebPushOptInMessage -This can be used to control the opt-in message for web push notifications. It can be set to either 'AUTOMATIC' or a boolean value. +The `setWebPushOptInMessage` controls whether the browser automatically prompts users for notification permissions (true or 'AUTOMATIC') or suppresses the prompt (false). It can be set to either 'AUTOMATIC' or a boolean value. It is an alternative to `webPushOptInMessage` inside the `` component. ```javascript -notificationapi.webPushOptInMessage = 'AUTOMATIC'; +notificationapi.setWebPushOptInMessage('AUTOMATIC'); ``` From 85191e5ee9ceaabfc061b251460bcd349b16aa92 Mon Sep 17 00:00:00 2001 From: A-KGeorge Date: Fri, 29 Nov 2024 13:11:04 -0330 Subject: [PATCH 11/15] updated web push react sdk --- docs/reference/react-sdk.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/reference/react-sdk.md b/docs/reference/react-sdk.md index f567dd1..4e5b363 100644 --- a/docs/reference/react-sdk.md +++ b/docs/reference/react-sdk.md @@ -135,7 +135,7 @@ For example, the web push service worker is placed at `public/service` folder an ### webPushOptInMessage -The `webPushOptInMessage` controls whether the browser automatically prompts users for notification permissions (true or 'AUTOMATIC') or suppresses the prompt (false). +The `webPushOptInMessage` controls whether the browser automatically prompts users for notification permissions (true or 'AUTOMATIC') or suppresses the prompt (false). It is set to `"AUTOMATIC"` by default. ```jsx @@ -561,7 +561,7 @@ notificiationapi.setWebPushOptIn(true); ## setWebPushOptInMessage -The `setWebPushOptInMessage` controls whether the browser automatically prompts users for notification permissions (true or 'AUTOMATIC') or suppresses the prompt (false). It can be set to either 'AUTOMATIC' or a boolean value. It is an alternative to `webPushOptInMessage` inside the `` component. +The `setWebPushOptInMessage` controls whether the browser automatically prompts users for notification permissions (true or 'AUTOMATIC') or suppresses the prompt (false). It can be set to either 'AUTOMATIC' or a boolean value. It is set to `"AUTOMATIC"` by default. It is an alternative to `webPushOptInMessage` inside the `` component. ```javascript notificationapi.setWebPushOptInMessage('AUTOMATIC'); From 346887eb56792dcc94dac44187ef371cf0190c96 Mon Sep 17 00:00:00 2001 From: A-KGeorge Date: Fri, 29 Nov 2024 13:15:25 -0330 Subject: [PATCH 12/15] removed sentences --- docs/reference/react-sdk.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/reference/react-sdk.md b/docs/reference/react-sdk.md index 4e5b363..6cfe1c5 100644 --- a/docs/reference/react-sdk.md +++ b/docs/reference/react-sdk.md @@ -135,7 +135,7 @@ For example, the web push service worker is placed at `public/service` folder an ### webPushOptInMessage -The `webPushOptInMessage` controls whether the browser automatically prompts users for notification permissions (true or 'AUTOMATIC') or suppresses the prompt (false). It is set to `"AUTOMATIC"` by default. +The `webPushOptInMessage` controls whether the browser automatically prompts users for notification permissions (`true` or `'AUTOMATIC'`) or suppresses the prompt (`false`). It is set to `"AUTOMATIC"` by default. ```jsx @@ -561,7 +561,7 @@ notificiationapi.setWebPushOptIn(true); ## setWebPushOptInMessage -The `setWebPushOptInMessage` controls whether the browser automatically prompts users for notification permissions (true or 'AUTOMATIC') or suppresses the prompt (false). It can be set to either 'AUTOMATIC' or a boolean value. It is set to `"AUTOMATIC"` by default. It is an alternative to `webPushOptInMessage` inside the `` component. +The `setWebPushOptInMessage` controls whether the browser automatically prompts users for notification permissions (`true` or `'AUTOMATIC'`) or suppresses the prompt (`false`). It is set to `"AUTOMATIC"` by default. It is an alternative to `webPushOptInMessage` inside the `` component. ```javascript notificationapi.setWebPushOptInMessage('AUTOMATIC'); From 054743b0f083d0cde5bf71da6b61eaf2ff0e723e Mon Sep 17 00:00:00 2001 From: mbasadi Date: Thu, 12 Dec 2024 13:05:22 -0500 Subject: [PATCH 13/15] improve the doc --- docs/guides/web-push.md | 107 ++++++++++++++++++------------------ docs/reference/react-sdk.md | 37 +++++-------- 2 files changed, 67 insertions(+), 77 deletions(-) diff --git a/docs/guides/web-push.md b/docs/guides/web-push.md index b8116cf..64be1f7 100644 --- a/docs/guides/web-push.md +++ b/docs/guides/web-push.md @@ -25,14 +25,14 @@ To set up Web Push Notifications with NotificationAPI, you'll need to: ## Step-by-Step Implementation -**Step 1: Create a Notification Template** +### **Step 1: Create a Notification Template** 1. Log in to the NotificationAPI Dashboard. 2. Create a new notification template. 3. Enable "Web Push" as a channel. 4. Customize the template to suit your needs. -**Step 2: Implement the Frontend SDK** +### **Step 2: Implement the Frontend SDK** Integrate the NotificationAPI Frontend SDK into your web page to handle user subscriptions and display notifications. @@ -67,11 +67,11 @@ import { NotificationAPIProvider } from '@notificationapi/react'; {/* your protected routes */} @@ -80,12 +80,12 @@ import { NotificationAPIProvider } from '@notificationapi/react'; #### Parameters -| Parameter | Type | Description | -| ----------------------- | ------ | ------------------------------------------------------------------------------------------------------------------ | -| clientId\* | string | Your NotificationAPI account clientId. You can get it from [here](https://app.notificationapi.com/environments). | -| userId\* | string | The unique ID of the user in your system. | -| hashedUserId | string | Only used for [Secure Mode](/guides/secure-mode). | -| customServiceWorkerPath | string | Path to your service worker file if it's not at the root (e.g., '/custom/path/notificationapi-service-worker.js'). | +| Parameter | Type | Description | +| ----------------------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------ | +| clientId\* | string | Your NotificationAPI account clientId. You can get it from [here](https://app.notificationapi.com/environments). | +| userId\* | string | The unique ID of the user in your system. | +| webPushOptInMessage | "AUTOMATIC" or Boolean | Control to show the web push opt in message. Default is "AUTOMATIC" | +| customServiceWorkerPath | string | Path to your service worker file if it's not at the root (e.g., '/custom/path/notificationapi-service-worker.js'). | \* Required parameters @@ -115,14 +115,11 @@ const notificationapi = new NotificationAPI({ #### Parameters -| Parameter | Type | Description | -| ----------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------ | -| clientId\* | string | Your NotificationAPI account clientId. You can get it from [here](https://app.notificationapi.com/environments). | -| userId\* | string | The unique ID of the user in your system. | -| userIdHash | string | Only used for [Secure Mode](/guides/secure-mode). | -| websocket | string | Only if you want to specify your region, for example, if your account is in Canada region you must pass 'wss://ws.ca.notificationapi.com'. | -| language | string | The language used for the pre-built UI widgets. Supported: `en-US`, `es-ES`, `fr-FR`, `it-IT`, `pt-BR` | -| customServiceWorkerPath | string | Path to your service worker file if it's not at the root (e.g., '/custom/path/notificationapi-service-worker.js'). | +| Parameter | Type | Description | +| ----------------------- | ------ | ------------------------------------------------------------------------------------------------------------------ | +| clientId\* | string | Your NotificationAPI account clientId. You can get it from [here](https://app.notificationapi.com/environments). | +| userId\* | string | The unique ID of the user in your system. | +| customServiceWorkerPath | string | Path to your service worker file if it's not at the root (e.g., '/custom/path/notificationapi-service-worker.js'). | \* Required parameters @@ -165,15 +162,16 @@ For more information please checkout our [vanilla JS SDK](/reference/js-client#s -**Step 3: Service Worker Setup** +### **Step 3: Service Worker Setup** The service worker manages background tasks and is essential for receiving push notifications. 1. **Download** notificationapi-service-worker.js 2. **Place the file** in the `public` folder of your web application. It should be accessible at `https://yourdomain.com/notificationapi-service-worker.js`. -3. **Update the SDK Initialization**: If the service worker is not at the root, specify its path using the `customServiceWorkerPath` parameter during SDK initialization. For example, it is accessible at `https://yourdomain.com/service/notificationapi-service-worker.js`, please specify its path using the `customServiceWorkerPath` parameter during SDK initialization. -Code examples for **step 3**: +:::note +If the service worker is not at the root, specify its path using the `customServiceWorkerPath` parameter during SDK initialization. For example, it is accessible at `https://yourdomain.com/service/notificationapi-service-worker.js`, please specify its path using the `customServiceWorkerPath` parameter during SDK initialization. + +> + + ```jsx {/* Your components */} @@ -201,15 +201,20 @@ values={[ const notificationapi = new NotificationAPI({ clientId: 'YOUR_CLIENT_ID', userId: 'UNIQUE_USER_ID', - customServiceWorkerPath: 'service/notificationapi-service-worker.js' + customServiceWorkerPath: '/service/notificationapi-service-worker.js' }); ``` -**Step 4: Give permission on your browser** +::: + +### **Step 4: Give permission on your browser** +#### **Option 1: Use NotificationAPI Pre-Built Component (Recommended)** + +Our SDKs provide an easy way to prompt users for permission to receive web push notifications. -**Option 1: Rely on NotificationAPI Pre-Built component (Recommended)** If you are using our react SDK to show in-app notifications. You can simply rely on our SDK to ask your users to opt in for web push notification. - -1. Place the `` component inside the `NotificationAPIProvider` component. For more information on the component please checkout our [React SDK](/reference/react-sdk#popup) guide. +If you are using the popup component, click on the ⚙️ icon, which is there in the top right corner. -2. Click on Notification Preferences. This would open a popup. - -3. Click on Yes. - -This would prompt the browser to ask for permission to show notifications. Alternatively, you can place the `` component inside the `NotificationAPIProvider` component. For more information on the component please checkout our [React SDK](/reference/react-sdk#preferences-popup) guide. +This would prompt the browser to ask for permission to show notifications. -**Option 2: Using built-in method** You can place the code inside a component which is inside the `NotificationAPIProvider` provided by the React SDK and call the `askForWebPushPermission` function when the user interacts with your application. +**Option 2: Using built-in method** You can use `useNotificationAPIContext`. ```jsx -const notificiationapi = NotificationAPIProvider.useNotificationAPIContext(); -const askForWebPushPermission = async () => { - notificiationapi.setWebPushOptIn(true); +const AskforPerm: React.FC = () => { + const notificationapi = NotificationAPIProvider.useNotificationAPIContext(); + + return ( + + ); }; + +export default AskforPerm; ``` -**Option 1: Rely on NotificationAPI Pre-Built component (Recommended)** -If you are using our front-end SDK to show in-app notifications. You can simply rely on our SDK to ask your users to opt in for web push notification. - -1. Click on the bell notification icon, and it will ask the user whether they want to web push notifications. +You can see the opt in message in both the notification components and user preference components. - -2. Click on Yes. - -This would prompt the browser to ask for permission to show notifications. - -3. If you do not see the message in the NotificationAPI, click on the bell notification icon and then click on the settings icon, which is there in the top right corner. +If you are using the popup component, you can click on the ⚙️ icon and then click on the settings icon, which is there in the top right corner. - -Click on Click here. +This would prompt the browser to ask for permission to show notifications. **Option 2: Using built-in method** You can use the following method to ask your user to opt in for the web Push notifications: @@ -277,7 +278,7 @@ notificationapi.askForWebPushPermission(); -**Step 5: Send Notifications from the Backend** +### **Step 5: Send Notifications from the Backend** With the frontend set up to receive notifications, you can now send them from your backend. diff --git a/docs/reference/react-sdk.md b/docs/reference/react-sdk.md index 6cfe1c5..420c970 100644 --- a/docs/reference/react-sdk.md +++ b/docs/reference/react-sdk.md @@ -108,14 +108,13 @@ Change the deafult notification sound to include your own: -### Custom path to web push service worker +### Customizing the path to web push service worker The service worker must be placed in the public folder. -The default path to the web push service worker is `/notificationapi-service-worker.js`, and is accessible at `https://yourdomain.com/notificationapi-service-worker.js` +By default we assume the service worker file is publicly associable at `https://yourdomain.com/notificationapi-service-worker.js` -If the default path is not suitable for your application, you can change the path to the web push service worker. -The service worker should be accessible at the path you specify. +If the default path is not suitable for your application, you can customize the path to the web push service worker. For example, the web push service worker is placed at `public/service` folder and is accessible at `https://yourdomain.com/service/notificationapi-service-worker.js` @@ -124,7 +123,7 @@ For example, the web push service worker is placed at `public/service` folder an @@ -133,16 +132,16 @@ For example, the web push service worker is placed at `public/service` folder an ; ``` -### webPushOptInMessage +### Customizing the web push opt in message -The `webPushOptInMessage` controls whether the browser automatically prompts users for notification permissions (`true` or `'AUTOMATIC'`) or suppresses the prompt (`false`). It is set to `"AUTOMATIC"` by default. +By default we automatically figure out if your user should see the web push opt in message or not. You can Customizing it like the following: ```jsx @@ -508,6 +507,12 @@ notificationapi.markAsArchived(['trackingId1', 'trackingId2']); notificationapi.markAsClicked('trackingId'); ``` +## asking for web push opt in + +```javascript +notificationapi.setWebPushOptIn(true); +``` + ## Concepts ### How does it work? @@ -551,22 +556,6 @@ notificationapi .then((result) => console.log(result)); ``` -## setWebPushOptIn - -To request permission for notifications, place the following code inside an async function, and call that function when the user interacts with your application. - -```javascript -notificiationapi.setWebPushOptIn(true); -``` - -## setWebPushOptInMessage - -The `setWebPushOptInMessage` controls whether the browser automatically prompts users for notification permissions (`true` or `'AUTOMATIC'`) or suppresses the prompt (`false`). It is set to `"AUTOMATIC"` by default. It is an alternative to `webPushOptInMessage` inside the `` component. - -```javascript -notificationapi.setWebPushOptInMessage('AUTOMATIC'); -``` - From c3b5b858d6bfc7e2beecf90d73f6e508735c874d Mon Sep 17 00:00:00 2001 From: mbasadi Date: Thu, 12 Dec 2024 13:09:13 -0500 Subject: [PATCH 14/15] typo --- docs/guides/web-push.md | 6 +++--- docs/reference/react-sdk.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/guides/web-push.md b/docs/guides/web-push.md index 64be1f7..0ce16d1 100644 --- a/docs/guides/web-push.md +++ b/docs/guides/web-push.md @@ -67,10 +67,10 @@ import { NotificationAPIProvider } from '@notificationapi/react'; {/* your protected routes */} diff --git a/docs/reference/react-sdk.md b/docs/reference/react-sdk.md index 420c970..a4cde40 100644 --- a/docs/reference/react-sdk.md +++ b/docs/reference/react-sdk.md @@ -110,7 +110,7 @@ Change the deafult notification sound to include your own: ### Customizing the path to web push service worker -The service worker must be placed in the public folder. +The service workermust be placed in the public folder. By default we assume the service worker file is publicly associable at `https://yourdomain.com/notificationapi-service-worker.js` From d1e77576ebf2b5eeb33c9cee5774cd7950f40edb Mon Sep 17 00:00:00 2001 From: mbasadi Date: Thu, 12 Dec 2024 13:14:27 -0500 Subject: [PATCH 15/15] typo --- docs/reference/react-sdk.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/reference/react-sdk.md b/docs/reference/react-sdk.md index a4cde40..d53c691 100644 --- a/docs/reference/react-sdk.md +++ b/docs/reference/react-sdk.md @@ -110,7 +110,7 @@ Change the deafult notification sound to include your own: ### Customizing the path to web push service worker -The service workermust be placed in the public folder. +The service worker must be placed in the public folder. By default we assume the service worker file is publicly associable at `https://yourdomain.com/notificationapi-service-worker.js` @@ -134,7 +134,7 @@ For example, the web push service worker is placed at `public/service` folder an ### Customizing the web push opt in message -By default we automatically figure out if your user should see the web push opt in message or not. You can Customizing it like the following: +By default we automatically figure out if your user should see the web push opt in message or not. You can customizing it like the following: ```jsx