I am trying to schedule a notification based off the users selected time, I guess like an alarm clock. I have not had much success finding help. do anyone know how to do this or can assist me? I guess I am trying to use scheduled notification.
Have you looked at the “Local Notifications” sample app (in the SampleCoce/Notifications/Local Notifications folder)?
Hi Rob,
I have been at this thing for months. But in a nutshell, yes I have looked at it. I just can not get it to do what I need it to do. When I pick a dat and time it sends it right away versus on the date and time I selected.
Does the sample app send right away?
I copied the code into my app to test it since I have it deployed on my phone for real time and yes it sent right away. That’s why I am stuck.
Hi Rob,
To make sure I am not missing anything can you explain where the Local Notifications" sample app (in the SampleCoce/Notifications/Local Notifications folder) you are referencing please?
/Applications/CoronaSDK/SampleCode/Notifications/LocalNotifications/main.lua
So this is where I am getting lost. I have applications/coronaSDK/SampleCode. But thats it there is no Notifications/LocalNotications/main.lua on mine. COuld you tell me why I do not have this?
Are you on a Mac or PC?
Is there anything in /Applications/CoronaSDK/SampleCode?
I am on a Mac,
But I guess I needed an update.I had to uninstall and re-install corona. Now I see the Local Notifications you mentioned. I will work from there. Thank you.
Hi again Rob,
Ok so as i said above I had to reinstall corona to see the localnotifcation. I am now getting this error: Scene1.lua:213: unexpected symbol near ‘=’
Which I did not get before reinstalling corona. I can not see what the error is. Can you take a peek?
<code>
– create a widget button (which will loads level1.lua on release)
playBtn = widget.newButton–{}
label “Schedule A Text”
labelColor { default={255}, over={120} }
default “button.png”
over “button-over.png”
width = 164, height = 44,
onRelease onPlayBtnRelease
event listener function
end
<\code>
playBtn = widget.newButton{ label = "Schedule A Text" labelColor = { default={255}, over={120} } default = "button.png" over = "button-over.png" width = 164, height = 44, onRelease = onPlayBtnRelease }
BTW, the new forums uses Square brackets [] around the code tags, not <>
With the old forums you were able to display the code lines. Are you not able to do that with the new forums? Is there something I can look at for the new changes made? since clearly I was building under the old forums.
Im sorry Rob but I am stilling getting the same error which is ironic because I had this working before he change.
Scene1.lua:214: unexpected symbol near ‘=’
FYI line 214 is the line with height.
-- create a widget button (which will loads level1.lua on release) playBtn = widget.newButton{} label = "Schedule A Text" labelColor = { default={255}, over={120} } default = "button.png" over = "button-over.png" width = 164, height = 44, onRelease = onPlayBtnRelease event listener function end
stack traceback:
[C]: ?
[C]: in function ‘error’
?: in function ‘gotoScene’
/Users/babybeanie98/Desktop/FM2/menu.lua:29: in function ‘_onRelease’
?: in function ‘?’
?: in function <?:1052>
?: in function <?:218>
menu.lua
-- forward declarations and other locals local playBtn -- 'onRelease' event listener for playBtn local function onPlayBtnRelease() --print("goto scene") -- go to level1.lua scene -- end storyboard.gotoScene( "Scene1") return true -- indicates successful touch end
See my comments inline below.
playBtn = widget.newButton{} --\<----- Do not close the curly bracket here. The next few lines are table parameters label = "Schedule A Text" --\<------ needs a comma at the end of the line. I probably missed these the first time labelColor = { default={255}, over={120} } --\<----- needs a comma at the end of the line default = "button.png" --\<----- needs a comma at the end of the line over = "button-over.png" --\<----- needs a comma at the end of the line width = 164, height = 44, onRelease = onPlayBtnRelease event listener function --\<---- I have no idea what you are trying to do here. remove this line end --\<----- I don't know what you are "end"ing here. You now need the closing curly brace to end the widget.newButton definition
playBtn = widget.newButton{ label = "Schedule A Text" , labelColor = { default={255}, over={120} }, default = "button.png", over = "button-over.png", width = 164, height = 44, onRelease = onPlayBtnRelease }
with the fixes this time.
Here is my new error: Attempt to concatenate global ‘sceneName’ (a nil value)
Since it does not state a location, how do I find where to fix the scene name? and what is stack traceback? All of this is new to me. I apologize.
stack traceback:
[C]: ?
?: in function ‘gotoScene’
/Users/babybeanie98/Desktop/FM2/menu.lua:28: in function ‘_onRelease’
?: in function ‘?’
?: in function <?:1052>
?: in function <?:218>
Are you using storyboard? Does the file: Scene1.lua have all the required code to make it a storyboard scene?
I honestly don’t know anymore. I had everything working. All I needed was help with the notification. With this new forum I am completely getting lost and frustrated. My app was pretty much done. Now I am seeming to be back tracking. I have not changed my storyboard from the original one. maybe I need to look at one of the new builds storyboard.