mirror of
https://gitlab.silvrtree.co.uk/martind2000/SODashServer.git
synced 2025-01-10 23:55:09 +00:00
Apple Push notifications. Trying something else. again
This commit is contained in:
parent
0945cb17ac
commit
13b7bd8b27
2
app.js
2
app.js
@ -222,7 +222,7 @@ app.post('/api/v1/register/ios', function(req, res) {
|
||||
registrationId = body['registrationId'];
|
||||
logger.debug(registrationId);
|
||||
|
||||
cal.registeriOSToken(id);
|
||||
cal.registeriOSToken(registrationId);
|
||||
|
||||
/* if (iosTokens.indexOf(registrationId) === -1) {
|
||||
iosTokens.push(registrationId);
|
||||
|
@ -347,11 +347,24 @@ var SOController = (function() {
|
||||
//
|
||||
|
||||
module.init = function() {
|
||||
console.log('-=# A #=-');
|
||||
attachClicks();
|
||||
console.log('-=# B #=-');
|
||||
clock();
|
||||
console.log('-=# C #=-');
|
||||
weatherClock();
|
||||
console.log('-=# D #=-');
|
||||
soWebSocket = new SOWEBSOCKET(this);
|
||||
setupPush();
|
||||
console.log('-=# E #=-');
|
||||
// Setup iOS notifications
|
||||
console.log('device.platform', device.platform);
|
||||
|
||||
console.log('-=# F #=-');
|
||||
if (device.platform === 'iOS' || device.platform === 'ios') {
|
||||
console.log('-=# F.2 #=-');
|
||||
setupPushNotifications();
|
||||
}
|
||||
console.log('-=# G #=-');
|
||||
};
|
||||
|
||||
module.updateCalendar = function(data) {
|
||||
@ -366,8 +379,6 @@ var SOController = (function() {
|
||||
if (window.cordova && !(window.cordova instanceof HTMLElement)) {
|
||||
if (device.platform === 'android' || device.platform === 'Android') {
|
||||
cordovaNotify(d);
|
||||
} else if (device.platform === 'iOS' || device.platform === 'ios') {
|
||||
setupPushNotifications();
|
||||
}
|
||||
} else {
|
||||
browserNotify(d);
|
||||
@ -382,11 +393,17 @@ function onDeviceReady() {
|
||||
SOController.init();
|
||||
}
|
||||
|
||||
;(function() {
|
||||
|
||||
if (window.cordova && !(window.cordova instanceof HTMLElement)) {
|
||||
document.addEventListener('deviceready', onDeviceReady, false);
|
||||
}
|
||||
|
||||
|
||||
/*;(function() {
|
||||
if (window.cordova && !(window.cordova instanceof HTMLElement)) {
|
||||
document.addEventListener('deviceready', onDeviceReady, false);
|
||||
} else {
|
||||
onDeviceReady();
|
||||
Notification.requestPermission();
|
||||
}
|
||||
})();
|
||||
})();*/
|
||||
|
Loading…
Reference in New Issue
Block a user