Skip to content

Commit

Permalink
Merge pull request #379 from shreyas1434shinde/InAppNotification
Browse files Browse the repository at this point in the history
Issue #PS-2407 fix: Notfication update API body updated
  • Loading branch information
itsvick authored Nov 10, 2024
2 parents a1c09bc + 4312539 commit 4053590
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion firebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const requestPermission = async () => {

if (permission === 'granted') {
const token = await getToken(messaging, {
vapidKey: process.env.NEXT_PUBLIC_VAPID_KEY,
vapidKey: "BOZ_JkC62vr767LoC7APU26ZdGYW5htBkfqIEtsVX6zmE3Fi-XgcN_TggSaXKh5rGKcaa4vuQxaYiRPU2B955GI",
});
console.log('Notification token:', token);
return token;
Expand Down
2 changes: 1 addition & 1 deletion public/firebase-messaging-sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ importScripts('https://www.gstatic.com/firebasejs/8.2.0/firebase-app.js');
importScripts('https://www.gstatic.com/firebasejs/8.2.0/firebase-messaging.js');

const firebaseConfig = {
apiKey: process.env.NEXT_PUBLIC_FCM_API_KEY,
apiKey: "AIzaSyCmhNz-HMkkf42QNmnf7pnZm49FP5g4INw",
authDomain: "backend-e99c8.firebaseapp.com",
projectId: "backend-e99c8",
storageBucket: "backend-e99c8.appspot.com",
Expand Down
2 changes: 1 addition & 1 deletion src/components/AllowNotification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const AllowNotification = () => {
try {
const token = await requestPermission();
if (token && userId && authToken) {
await UpdateDeviceNotification([{ deviceId: token }], userId, {
await UpdateDeviceNotification({ deviceId: token }, userId, {
tenantId,
Authorization: `Bearer ${authToken}`,
});
Expand Down
6 changes: 3 additions & 3 deletions src/services/NotificationService.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SendCredentialsRequest } from '@/utils/Interfaces';
import { post,get } from './RestClient';
import { post, get } from './RestClient';
import { toPascalCase } from '@/utils/Helper';
import axios from 'axios';

Expand Down Expand Up @@ -87,7 +87,7 @@ export const sendEmailOnLearnerCreation = async (


export const UpdateDeviceNotification = async (
userData: { deviceId: string }[],
userData: { deviceId: string },
userId: string,
headers: { tenantId: string; Authorization: string }
): Promise<any> => {
Expand Down Expand Up @@ -131,7 +131,7 @@ export const sendNotification = async ({
isQueue,
context,
key,
push
push
});
return response?.data?.result;
} catch (error) {
Expand Down

0 comments on commit 4053590

Please sign in to comment.