To implement a push notification, you can follow this link (which you already followed, and this is for the updated plugin, another tutorial that you mentioned explained the old deprecated plugin).
ios android, .
, (iOS Android), - :
push.on('registration', function(data) {
var deviceToken = data.registrationId
});
, :
.
( . ). :
var devicePlatform = device.platform;
:
function getDevicePlatform() {
var userAgent = navigator.userAgent || navigator.vendor || window.opera;
if (/windows phone/i.test(userAgent)) {
return "Windows";
}
if (/android/i.test(userAgent)) {
return "Android";
}
if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
return "iOS";
}
return "unknown";
}
, .
, , .
, .