Hi!
I am a little bit confused about how the geotrigger-handler interact with the rest of my Titanium IOS-app when writing something in the resources/plotgeotriggerhandler.js. I have read the documentation but still not get it. The documentation says that you cannot reference global variables or views from the plotgeotriggerhandler.js. But when reading about the geotriggers it says that you can "use them as trigger events for your own code”.
I am trying to change a variable in my app.js (classic, non-alloy) when entering a geofence called "zoneA". Lets say I want an entrance to change:
var enteringzoneA = 0
to be
enteringzoneA = 1
If the app is in the background this eventtrigger can wait until the app is open again. If the app is already open this should happen directly.
Is this possible? Or can you only trigger Plot related code?
Thanks for taking a look at my question!
Andreas
Ti.App.Properties.setBool('key', true);var value = Ti.App.Properties.getBool('key');////////////////In plotgeotriggerhandler.js//////////////////////////////
plot.addEventListener("plotNotificationReceived", function(){
Ti.App.Properties.setBool(”key", true);
});
plot.initPlot(config);
//////////////////In app.js//////////////////////////////////////////////////
var plot = require('com.plotprojects.ti');
plot.initPlot({ geotriggerHandlerEnabled: true });
var value = Ti.App.Properties.getBool("key");
Ti.App.addEventListener('app:resumed', function(e){
value = Ti.App.Properties.getBool("key");
askifvisited ();
});
askifvisited ();
function askifvisited (){
if (value === true){
alert("you have visit zone A");
}
else
{
alert("you have NOT visit zone A");
}
}
//////////////////////////////////////////////////////////////////////////
"Something went wrong with this dashboard request.
To view this discussion on the web visit https://groups.google.com/d/msgid/plot-users/9fef9e12-69c9-46ba-8fb0-0133c13cd40f%40googlegroups.com.--
You received this message because you are subscribed to a topic in the Google Groups "plot-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/plot-users/VYYf3BfHhl4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to plot-users+...@googlegroups.com.
Visit this group at http://groups.google.com/group/plot-users.
Ti.App.Properties.setString('key', geotrigger);
--
--
You received this message because you are subscribed to the Google Groups "plot-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plot-users+...@googlegroups.com.
Visit this group at http://groups.google.com/group/plot-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/plot-users/CAEN%3DwSXgJw7462PaDow0ZhMAeBCgF3rSge4Vj5Wy%3DN0Pwa2C%2Bw%40mail.gmail.com.