Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
initPushNotification() {
if (!this.platform.is('cordova')) {
console.warn("Push notifications not initialized. Cordova is not available - Run in physical device");
return;
}
Backendless.setupDevice({
uuid: Device.uuid,
platform: Device.platform,
version: Device.version
});
let push = Push.init({
android: {
senderID: "YOUR_SENDER_ID"
},
ios: {
alert: "true",
badge: false,
sound: "true"
},
windows: {}
});
onRegister: function(device) {
Backendless.setupDevice({
uuid : DeviceInfo.getUniqueID(),
platform: device.os,
version : DeviceInfo.getSystemVersion()
});
Backendless.Messaging.registerDevice(device.token).then(
function() {
alert("Registration done");
},
function() {
alert("Oops. Something went wrong");
}
);
},