@runnerpro/backend 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -44,25 +44,34 @@ function notificationIOS(msg, token) {
|
|
|
44
44
|
var apnProvider = new apn.Provider(options);
|
|
45
45
|
var note = new apn.Notification();
|
|
46
46
|
note.expiry = Math.floor(Date.now() / 1000) + 3600 * 24; // Expires 24 hour from now.
|
|
47
|
-
note.alert = {
|
|
47
|
+
note.alert = {
|
|
48
|
+
title: 'RunnerPro',
|
|
49
|
+
subtitle: msg.title || '',
|
|
50
|
+
body: msg.body,
|
|
51
|
+
};
|
|
48
52
|
note.topic = 'ios.runnerpro.cliente';
|
|
49
53
|
apnProvider.send(note, token);
|
|
50
54
|
});
|
|
51
55
|
}
|
|
52
56
|
function notificationWEB(firebaseMessaging, msg, token) {
|
|
53
57
|
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
-
|
|
55
|
-
.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
58
|
+
if (!msg.title)
|
|
59
|
+
msg.title = '';
|
|
60
|
+
console.log(msg);
|
|
61
|
+
// firebaseMessaging
|
|
62
|
+
// .send({
|
|
63
|
+
// token,
|
|
64
|
+
// data: msg,
|
|
65
|
+
// })
|
|
66
|
+
// .catch((error: any) => {
|
|
67
|
+
// if (
|
|
68
|
+
// error.errorInfo.code === 'messaging/registration-token-not-registered'
|
|
69
|
+
// ) {
|
|
70
|
+
// // query(
|
|
71
|
+
// // 'DELETE FROM [PUSH MANAGER] WHERE [ID CLIENTE] = ? AND [SUBSCRIPTION] = ?',
|
|
72
|
+
// // [idCliente, subscription]
|
|
73
|
+
// // );
|
|
74
|
+
// }
|
|
75
|
+
// });
|
|
67
76
|
});
|
|
68
77
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/sendNotification/index.ts"],"names":[],"mappings":"AAGA,UAAU,YAAY;IACpB,iBAAiB,EAAE,GAAG,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/sendNotification/index.ts"],"names":[],"mappings":"AAGA,UAAU,YAAY;IACpB,iBAAiB,EAAE,GAAG,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,QAAA,MAAM,gBAAgB,wDAMnB,YAAY,kBA2Bd,CAAC;AAsDF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runnerpro/backend",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "A collection of common backend functions",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./lib/cjs/index.js"
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
"author": "Runner Pro",
|
|
34
34
|
"license": "MIT",
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@types/chai": "4.3.
|
|
37
|
-
"@types/mocha": "
|
|
38
|
-
"chai": "
|
|
39
|
-
"del-cli": "5.
|
|
40
|
-
"mocha": "10.
|
|
41
|
-
"semantic-release": "
|
|
42
|
-
"ts-node": "10.9.
|
|
43
|
-
"typescript": "
|
|
36
|
+
"@types/chai": "4.3.12",
|
|
37
|
+
"@types/mocha": "10.0.6",
|
|
38
|
+
"chai": "5.1.0",
|
|
39
|
+
"del-cli": "5.1.0",
|
|
40
|
+
"mocha": "10.3.0",
|
|
41
|
+
"semantic-release": "23.0.2",
|
|
42
|
+
"ts-node": "10.9.2",
|
|
43
|
+
"typescript": "5.3.3"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"@parse/node-apn": "6.0.1",
|