Send notifications with Codea

Can you make is so you can send notifications to the people with the app? Can you do this with codea?

Within your game/simulation you can, but not a system alert like on the lock screen, but it might be possible in Xcode or other languages, just not Lua/Codea

what do you mean when you said within game simulation? @codeanoob

Not on the ipad lockscreen but it tells you within game

Really! Awesome! Do you know how to do this? I would really like to do this! @codeaNoob

I personally(as my name suggests) am not the most skilled with Codea, but try JMV 38 or the Cider Menu creator

Look in the documentation for alert() I believe that is what you want

Try this: alert("Test Message", "Test Title")

if you’re thinking of being able to write messages that users see when they next run your app, then you need to have a webpage with your message on it, and your app needs to use http.request to read the web page when starting up. if there is a message, you can display it with the alert function.

If you do this, make sure it doesnt crash if the iPad has no internet access!

thanks @ignatz

I got it to connect with http.request but how can I have it take the information that I want it to and have is show up in to app? For example lets I have it connected to a website were they post inspirational quotes and I want it to take only the quote and display it in my app? @ignatz

You have to read the HTML webpage, which is a big text string, and pull out the bit you want, no shortcuts unfortunately

Best is to load the page on your PC/Mac, view source of the page, and figure out where the bit you want is, and how to identify the place where it starts and ends

ok so once I figure out what I wont how would I put that into my code? would i just cody and paste the part i wont? @ignatz

No, you need to use string.find(), string.match(), string.gmatch(), etc. to try and parse the HTML to get the text you want. Copying it would only use the quote posted at the time you copied it.

Hint: The quote would probably start with <p> and end with </p>, the paragraphs in HTML.

Edit: Odd, I had to put the <p> as a bit of code, as pure text and ~~~ didn’t work… Just made a line space.

Test

Huh… That’s funny. I can write pure HTML in here. That line above is <a href="http://www.twolivesleft.com/">Test</a>.