Discord
Login
Community
DARK THEME

How to Send Notifications for Android | iOS | Desktop

I would like to know if it's possible to send notifications with the API we currently have available.

If not, where is the code for me to add the API access?

I know how to code for android, Javascript and iOS and it's possible for me to add the API for multiple platforms(including desktop linux if viable)

Thanks

MicroScript has the following capabilities:

system.say( message )

Opens a window to display a text message.

system.prompt( message, callback )

Opens a window asking the user to input text.

You can use the option to add code in javascript and use the notifications provided by the browser >> https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API/Using_the_Notifications_API

Thanks I'll try it (:

I would also like to know how would I go on to access the lua+js -> .apk in order to add functionality, I would like to add more APIs

I don't know if it works in Lua (I've never written in this language).

MicroScript2.0 you do this:

  • To add functions and classes that work in javascript you need to create a new file.

  • In the first line you enter //javascript

  • You enter the code. you add the variables you want to be visible in MicroScript2.0 to the global object.

e.g.:

MyClass = class{....}
global.MyClass = MyClass;
  • Now the variable/class is visible in the MicroScript code and you refer to it

myClass = new MyClass()

  • you can also add javascript code from MicroScript. You call, for example:
   system.javascript("""
     global.MyClass = class{};
   """)

Defects

  • it is difficult to rewrite a larger library
  • javascript code is very susceptible to condition race. (code from one file may be executed first, and code from the second file may be executed first)
  • it's hard to debug - but I wrote a small library that makes it easier.

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community