Read parameter from main.lua

I need to read some parameters from main.lua on app Launch

EXPLAINATION

  1. I will open the already installed app “mySampleApp” from a website using javascript

    <html> <head></head> <body> <script type=“text/javascript”> window.open(“mySampleApp://”,"_self") </script> Hello </body> </html>

It works fine !!!

  1. I need to read some parameters when i open the app like below

    window.open(“mySampleApp://myParameters”,"_self")

There is a way to read the parameters myParameters ???

Thank you for help

You can get the launch args like so. Add this to your main.lua file, at the top of the file.

local launchArgs = ...

Hi Danny,

thank you for you quick reply

I tested your hint just on the simulator and it doesn’t work

I just tested it on the simulator, hoping that launchArgs[0] it’s the AppName but it return nil

Do you think it will work on device ? Or I’m doing something wrong ?

Thank you again

Giorgio

Sorry for the late reply. This got buried in my inbox.

Can you post up the full url you are opening from the web, and the output of launchargs please?

Thanks

You can get the launch args like so. Add this to your main.lua file, at the top of the file.

local launchArgs = ...

Hi Danny,

thank you for you quick reply

I tested your hint just on the simulator and it doesn’t work

I just tested it on the simulator, hoping that launchArgs[0] it’s the AppName but it return nil

Do you think it will work on device ? Or I’m doing something wrong ?

Thank you again

Giorgio

Sorry for the late reply. This got buried in my inbox.

Can you post up the full url you are opening from the web, and the output of launchargs please?

Thanks