• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SImple Stand-Alone Applicatiopn with a Local Only DataBase
#2
(01-18-2020, 04:30 PM)clarencemartin Wrote: Can you explain how I can create a simple stand-alone application that does not use Cloud Data Storage?
I know that I can do local data calls only, to the local device, but how would the user of this Local Stand-alone application by-pass the log-on?
What would be the code that bypasses the need to log-in to the application and where would I put it?
Can you please provide a sample?

Hi Clarence,

cdb_auth needs to be called regardless of cloud or local storage. Local auth will attempt to decrypt files on disk with the credentials provided. If you want the app to be completely offline, you have a couple options in this case.

1. create a shared user and give the credentials to your users. all users will use the same email and password to login
2. create a shared user and hardcode the credentials in your code

The following is an example of the login process assuming you are hardcoding the credentials:

Code:
on openCard
    local tStatusA
   
    get cdb_auth("user@default.com", "password", "user")
   
    if not cdb_result() then
         answer "There was a problem authorizing user: " & cdb_result("response")
    else
         put cdb_authStatus() into tStatusA
         
         if tStatusA["local"] is true then
              cdb_loadTable
             
              #Your user can now use the app offline
              #Now you can go to the next card or show the UI after the login is successful
         else
              #You shouldn't fall into this case but I like having it for sanity check
              answer "You do not have access to the app offline."
         end if
    end if
end openCard
  Reply


Messages In This Thread
RE: SImple Stand-Alone Applicatiopn with a Local Only DataBase - by efrain.c - 01-21-2020, 12:41 AM

Forum Jump:


Users browsing this thread: 3 Guest(s)