Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ibrahimmalhas patch web push notification bug fixes #174

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { getOneSignalRegistrationInfo } = require('../Shared/OneSignalRegistrationTokens.js');

const fetch = require("node-fetch");
// Your OneSignal app info
const app1_oneSignalAppId = '<Your OneSignal app Id>';
const app1_oneSignalRestApiKey = 'Basic <Your OneSignal REST API Key>';
Expand Down Expand Up @@ -47,4 +47,4 @@ module.exports = async function (context, eventGridEvent) {
context.error(e);
throw e;
}
};
};
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const oneSignalRegistrationTokens = new Map();

function getOneSignalRegistrationToken(communicationUserId) {
function getOneSignalRegistrationInfo(communicationUserId) {
return oneSignalRegistrationTokens.get(communicationUserId);
}

function setOneSignalRegistrationToken(communicationUserId, token) {
function setOneSignalRegistrationInfo(communicationUserId, token) {
oneSignalRegistrationTokens.set(communicationUserId, token);
}

module.exports = {
getOneSignalRegistrationToken,
setOneSignalRegistrationToken
};
};
1 change: 1 addition & 0 deletions calling-web-push-notifications/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"@azure/communication-calling": "1.13.2-beta.1",
"@azure/communication-common": "^2.2.0",
"@azure/logger": "^1.0.2",
"node-fetch": "^2.7.0",
"react-onesignal": "^2.0.4"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion calling-web-push-notifications/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const registerCommunicationUserForOneSignal = async (communicationUserToken) =>
},
data: JSON.stringify({
communicationUserId: communicationUserToken.user.communicationUserId,
oneSignalRegistrationToken,
oneSignalRegistrationToken: oneSignalRegistrationToken,
oneSignalAppId: clientConfig.oneSignalAppId
})
}).then((response) => { return response.data });
Expand Down