This commit is contained in:
silas
2018-11-01 13:44:20 +01:00
parent 1bac3c5b55
commit 84913c2bb1
9 changed files with 204 additions and 137 deletions

View File

@@ -91,24 +91,23 @@ InitPromise.resolve(app).then(async function () {
MyStorageManager.getInstance().persist();
}
window["applyAndroidBridge"] = AndroidBridge.applyDefinitions;
});
console.log("trying push... 1");
navigator.serviceWorker["ready"].then(function (registration) {
console.log("trying push... 2");
registration["pushManager"]["subscribe"]({
"userVisibleOnly": true,
"applicationServerKey": new Uint8Array([0x4, 0x53, 0xb7, 0x8d, 0xc6, 0xd1, 0x1a, 0xd4, 0x8b, 0xb2, 0xeb, 0x82, 0xf0, 0x9e, 0x12, 0xf6, 0xd, 0x32, 0x18, 0xa, 0x35, 0xf, 0x2d, 0x4c, 0x5, 0x29, 0x15, 0x95, 0x23, 0xb1, 0xd3, 0xab, 0x87, 0x88, 0x85, 0x1d, 0xc0, 0x98, 0x6e, 0x65, 0xe3, 0xcb, 0xa2, 0x28, 0x63, 0x7, 0x34, 0x9b, 0xfa, 0x46, 0x9a, 0x49, 0xcc, 0x70, 0x7a, 0xdd, 0xbe, 0x1e, 0xfc, 0xde, 0xcc, 0xb3, 0x5b, 0xcb, 0xf4])
}).then(function (sub) {
console.log("trying push... 3");
console.log("Subscription", sub);
}).catch(function (e) {
// if ('Notification' in window && Notification.permission === 'denied') {
// console.warn('Permission for notifications was denied');
// } else {
// console.error('Unable to subscribe to push', e);
// }
});
});
// console.log("trying push... 1");
// navigator.serviceWorker["ready"].then(function (registration) {
// console.log("trying push... 2");
// registration["pushManager"]["subscribe"]({
// "userVisibleOnly": true,
// "applicationServerKey": new Uint8Array([0x4, 0x53, 0xb7, 0x8d, 0xc6, 0xd1, 0x1a, 0xd4, 0x8b, 0xb2, 0xeb, 0x82, 0xf0, 0x9e, 0x12, 0xf6, 0xd, 0x32, 0x18, 0xa, 0x35, 0xf, 0x2d, 0x4c, 0x5, 0x29, 0x15, 0x95, 0x23, 0xb1, 0xd3, 0xab, 0x87, 0x88, 0x85, 0x1d, 0xc0, 0x98, 0x6e, 0x65, 0xe3, 0xcb, 0xa2, 0x28, 0x63, 0x7, 0x34, 0x9b, 0xfa, 0x46, 0x9a, 0x49, 0xcc, 0x70, 0x7a, 0xdd, 0xbe, 0x1e, 0xfc, 0xde, 0xcc, 0xb3, 0x5b, 0xcb, 0xf4])
// }).then(function (sub) {
// console.log("trying push... 3");
// console.log("Subscription", sub);
// }).catch(function (e) {
// // if ('Notification' in window && Notification.permission === 'denied') {
// // console.warn('Permission for notifications was denied');
// // } else {
// // console.error('Unable to subscribe to push', e);
// // }
// });
// });