I'm trying to pass a variable to my backgroundService.js and them set the push time through this variable... but it is not working... only work if I manually set the time in milliseconds ...
// app.js
var timer = 2000
Ti.App.Properties.setString( 'pushTime', timer )
var service = Ti.App.iOS.registerBackgroundService({
url:'bg.js'
})
// bg.js
var timer = Ti.App.Properties.getString( 'pushTime' )
Ti.API.info( timer )
var notification = Ti.App.iOS.scheduleLocalNotification({
alertBody:"Passou a bebedeira ja?",
alertAction:"Ok",
userInfo:{"hello":"world"},
sound:"pop.caf",
badge: 1,
date:new Date(new Date().getTime() + timer )
})
someone knows why when I use timer
instead 2000
it not work?
Thanks
3.1.1
iOS