Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function initBeacon() {
TiBeacon.initializeBeaconMonitoring({
success: function(e) {
Ti.API.info("success: " + JSON.stringify(e));
beaconsRegistered();
},
error: function(e) {
Ti.API.error(JSON.stringify(e));
alert("This device doesn't support iBeacons");
},
region: function(e) {
Ti.API.info("region changed event: " + JSON.stringify(e));
("Immediate" === e.proximity || "Near" === e.proximity) && TiBeacon.sendLocalNotification({
message: "Looks like you might be ready for a new journey! Tap to start logging with TripLogr.",
sound: "/sounds/honk.mp3"
});
},
ranged: function(e) {