Notification at 20h

ciginfo

Well-Known Member
Licensed User
Longtime User
Hello,
I would like to send a notification every day at a specified time. For example a notifcation every day at 20 hours. ("Alert" = the message body)
I use service module named "Alarm" I do not know what to put in Service_Create and in Service_Start.

I place in Sub Service_Start

Dim n as Notification
n.Initialize
n.Icon = "icon"
n.SetInfo ("title", "Alert", "")
n.Vibrate = True
n.Notify (1)

In Service_Create I put the code like
If it is 20h Then
StartService (Alarm)
End If

Am I on a good track?
 

thedesolatesoul

Expert
Licensed User
Longtime User
Almost,
there are a couple of things you need to consider for e.g. if the phone is sleeping or not
I would recommend using StartServiceAt command in which you can specify when the service needs to start.
since this is a repeating occurence you can use StartServiceAt to schedule the next service start, after you display the notification.
 
Upvote 0

ciginfo

Well-Known Member
Licensed User
Longtime User
Please, can you give me an example? I don't see how to use StartserviceAt and where i have to write the code. Thank you for your aid.
 
Upvote 0

ciginfo

Well-Known Member
Licensed User
Longtime User
I begin to understand but I do not see very well where to place the instruction "StartServiceAt" when it has to trigger itself for example every day at the same time. In the labor-module or service module? And if in the service-module, in which instruction, Sub Service_Start?
I understand when the service is triggered by clicking a button for example, but I do not see when the service is itself triggered.
Perhaps you don't understand my bad english?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…