06-09-2021, 04:43 PM
One more thought. If your mainstack is just a splash or loader that in turn loads up your actual app, you can place your init code in one of the mainstacks that are loaded after the fact. LiveCode can update those stacks because only the splash stack has been turned into a standalone.
You will not need to use cdb_autoSetupAuthKey(). Internally, CanelaDB calls cdb_autoSetupAuthKey() for you, after a successful cdb_auth(), and checks the mainstack relative to the code for your init handler.
cdb_autoSetupAuthKey() is for those that want to place their init handler is a custom location that is not part of the script stack of a mainstack or card 1 of script of a mainstack. As an example, Appli has its init code in a stack that is loaded long after the standalone is started. We use cdb_autoSetupAuthKey() to manage updating our init code with the current authKey by calling cdb_autoSetupAuthKey() right after a successful cdb_auth() call in our log in screen.
You will not need to use cdb_autoSetupAuthKey(). Internally, CanelaDB calls cdb_autoSetupAuthKey() for you, after a successful cdb_auth(), and checks the mainstack relative to the code for your init handler.
cdb_autoSetupAuthKey() is for those that want to place their init handler is a custom location that is not part of the script stack of a mainstack or card 1 of script of a mainstack. As an example, Appli has its init code in a stack that is loaded long after the standalone is started. We use cdb_autoSetupAuthKey() to manage updating our init code with the current authKey by calling cdb_autoSetupAuthKey() right after a successful cdb_auth() call in our log in screen.