Push notifications
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Push notifications
Actually all you need is event day time.
"convert "9/1/13" to seconds"
Doesn't matter when you start.
Simon
"convert "9/1/13" to seconds"
Doesn't matter when you start.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Push notifications
That makes this so much easier! Here I was making it so that it would get the date of the event, then split it up by the /, then take the day and subtract it from the current day, and same for the month and year, and repeat
. Glad to know that there's a much easier way
!


Re: Push notifications
You can do a test for me.
Since I don't think you can cancel a notification once it's set on the device, can you add another notification at the same seconds with a payload of "This has been canceled"?
Simon
Since I don't think you can cancel a notification once it's set on the device, can you add another notification at the same seconds with a payload of "This has been canceled"?
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Push notifications
What exactly is the payload and badge :S? I didn't quite get it when I was reading it :S. Also, there's the mobileCancelLocalNotification command, which seems like if you enter in the right syntax, it will cancel said notification. The command is "mobileCancelLocalNotification notification" Would it be the badge number, or the payload, or what :S?
Re: Push notifications
Ok wicked there is a cancel. Good news.
For the different alert... just fill them all and see where they end up.
For the different alert... just fill them all and see where they end up.
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Push notifications
Which different alerts is that?
Re: Push notifications
Hmm. I'm having a bit of trouble with the convert to seconds. I've got:
Which all mostly works. But for some reason, when I test it out with the time 10:10PM, it doesn't quite convert the time properly. Instead of using the time of the event, it's using the current time
. It's a problem with how I've used the it part of the code, isn't it
? Also, I can finally use the code tags
!
Code: Select all
convert date() to seconds
put it into datesec
convert time() to seconds
put it into timesec
convert word 1 of eventtime to seconds
put it into eventsec
answer eventsec
if word 2 of eventtime = "PM" then
put eventsec+43200 into eventsec
end if



Re: Push notifications
Look up dateItems, in your app you don't have to use it but it's format can be converted to seconds
e.g.
convert "2013,8,21,17,56,0,4" to seconds
the items above are described in the dateItems.
Simon
e.g.
convert "2013,8,21,17,56,0,4" to seconds
the items above are described in the dateItems.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Push notifications
Hmm. I think for now I like the method I'm using. I just can't figure out why it's not working and using the time instead of the eventsec 

Re: Push notifications
It's hard to say why it's failing until we know what's in eventtime. What's the value?
Simon's right though, dateitems would do a better job. It handles all sorts of things automatically without any calculations.
Simon's right though, dateitems would do a better job. It handles all sorts of things automatically without any calculations.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Push notifications
Sorry, I realised last night that I forgot to include eventtime! I figured it out sort of though? Instead of using:
I just eneded to use:
Not entirely sure why it works, but it seems to work now
!
Code: Select all
convert word 1 of eventtime to seconds
put it into eventsec
Code: Select all
put word 1 of eventtime into eventsec
convert eventsec to seconds

Re: Push notifications
I've had inconsistent results when I don't put the time/date into a variable before using the convert command. I think you just hit one of those. I always use this form:
Code: Select all
put the date into tDate
convert tDate to seconds
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Push notifications
That could be it. Either way, I'm rather glad it works
. It was quite annoying when it wasn't working 

