Example: Schedule a notification for 15 minutes and save the user's location.
If the user leaves radius, the notification will not be sent.
Would it be possible to do this using onesignal or just with cordovaLocalNotification?
var notificationObj = {
contents: {
en: "asdasdasd"
},
include_player_ids: [playerId],
send_after: "2017-02-15 20:42:00 GMT-0200",
}
window.plugins.OneSignal.postNotification(notificationObj,
function(successResponse) {
console.log("Notification Post Success:", successResponse);
},
function (failedResponse) {
console.log("Notification Post Failed: ", failedResponse);
alert("Notification Post Failed:\n" + JSON.stringify(failedResponse));
}
)
})
Before that I would save the current location and at the time of sending I would compare if the location is within the 1km radius. If yes, I would send it if not, I would not send