First login screen/popup

Its possible when user open app for first time show message(screen or popup) like idk hmm (privacy policy) but only on the first login.

I tried to search some kind of function for do that but i had no luck.

How i can do that? Its even possible?

Thanks.

Yes it is possible.  Learn to read and write tables.  Load a table when launching.  If it doesn’t exist create and save it.  At that time, you’ll know it is the first run.  So do your ‘first run stuff’.

As far as ‘functions to do an exact thing’.  This is an SDK of fundamental operations and actions.  You’ll need to build up specific cases yourself.  Fortunately, you can easily find code to do the ‘parts’.

For example, there are probably a dozen examples showing how to save and load files from persistent memory.

‘site: coronalabs.com save load table’

https://coronalabs.com/blog/2014/10/14/tutorial-saving-and-loading-lua-tables-with-json/

There are also tons of external sources (Git Hub is a great place to search):

Thanks for your answer @roaminggamer love u

i find a .lua script for understand better how tables works, thanks to @robmiracle

I did the installation, downloaded loadsave.lua script and put it on project /

Code:

This on my main.lua

local loadsave = require("loadsave") local t = {} t.number = 10 t.string = "Hello World" t.bool = true t.table = { someOtherString = "this is a test", someOtherNumber = 5} loadsave.saveTable(t, "myTable.json", system.DocumentsDirectory) newTable = loadsave.loadTable("myTable.json", system.DocumentsDirectory) loadsave.printTable(newTable)

In the Corona simulator on terminal prompt prints this:

01:57:55.379 table: 0CD7F2B0 { 01:57:55.379 [number] =\> 10 01:57:55.379 [string] =\> "Hello World" 01:57:55.379 [bool] =\> true 01:57:55.379 [table] =\> table: 0CD7F2B0 { 01:57:55.379 [someOtherString] =\> "this is a test" 01:57:55.379 [someOtherNumber] =\> 5 01:57:55.379 } 01:57:55.379 }

Do you have any idea or where start about displaying a message on the first load?

I tried this:

local options = { rationaleTitle = "Test title", rationaleDescription = "Test message" } local loadsave = require("loadsave") local t = {} t.number = 10 t.string = "Hello World" t.bool = true t.table = { someOtherString = "this is a test", someOtherNumber = 5} native.showPopup( "test", options ) loadsave.saveTable(t, "myTable.json", system.DocumentsDirectory) newTable = loadsave.loadTable("myTable.json", system.DocumentsDirectory) loadsave.printTable(newTable)

Thanks again, mate.

upp

You should have something like this at the start:

policyShown = false -- read policyShown from file and assign the stored value. -- read file here. if (not policyShown) then -- (policyShown == false) showPolicy() end

Yes it is possible.  Learn to read and write tables.  Load a table when launching.  If it doesn’t exist create and save it.  At that time, you’ll know it is the first run.  So do your ‘first run stuff’.

As far as ‘functions to do an exact thing’.  This is an SDK of fundamental operations and actions.  You’ll need to build up specific cases yourself.  Fortunately, you can easily find code to do the ‘parts’.

For example, there are probably a dozen examples showing how to save and load files from persistent memory.

‘site: coronalabs.com save load table’

https://coronalabs.com/blog/2014/10/14/tutorial-saving-and-loading-lua-tables-with-json/

There are also tons of external sources (Git Hub is a great place to search):

Thanks for your answer @roaminggamer love u

i find a .lua script for understand better how tables works, thanks to @robmiracle

I did the installation, downloaded loadsave.lua script and put it on project /

Code:

This on my main.lua

local loadsave = require("loadsave") local t = {} t.number = 10 t.string = "Hello World" t.bool = true t.table = { someOtherString = "this is a test", someOtherNumber = 5} loadsave.saveTable(t, "myTable.json", system.DocumentsDirectory) newTable = loadsave.loadTable("myTable.json", system.DocumentsDirectory) loadsave.printTable(newTable)

In the Corona simulator on terminal prompt prints this:

01:57:55.379 table: 0CD7F2B0 { 01:57:55.379 [number] =\> 10 01:57:55.379 [string] =\> "Hello World" 01:57:55.379 [bool] =\> true 01:57:55.379 [table] =\> table: 0CD7F2B0 { 01:57:55.379 [someOtherString] =\> "this is a test" 01:57:55.379 [someOtherNumber] =\> 5 01:57:55.379 } 01:57:55.379 }

Do you have any idea or where start about displaying a message on the first load?

I tried this:

local options = { rationaleTitle = "Test title", rationaleDescription = "Test message" } local loadsave = require("loadsave") local t = {} t.number = 10 t.string = "Hello World" t.bool = true t.table = { someOtherString = "this is a test", someOtherNumber = 5} native.showPopup( "test", options ) loadsave.saveTable(t, "myTable.json", system.DocumentsDirectory) newTable = loadsave.loadTable("myTable.json", system.DocumentsDirectory) loadsave.printTable(newTable)

Thanks again, mate.

upp

You should have something like this at the start:

policyShown = false -- read policyShown from file and assign the stored value. -- read file here. if (not policyShown) then -- (policyShown == false) showPolicy() end