I am a newbie in Corona SDK. I am creating some little apps but, as you all know, to implement a login and register methods is a must in every single applications we do.
The thing is, I dont know how to do theses functions using Corona SDK and I didn’t find an easy explanation on the Internet. Could you give me any reference or example to do this? It would be very appreciated.
Hi @scerro. This is a very complex issue. Not that any of the individual parts are hard, but that there are too many variables. Why do you need to log people in? What features do the get? Do you have an existing web server/database system? Are you trying to use some existing web service? Are you in control of the server side or has someone else built what you’re trying to use?
Without knowing these answers, it’s going to be really hard to advise you. You can google around for Corona and REST API’s to get a basic understanding of the technology in use. You will be using the network.request(), native.newTextField() and probably display.newText() API calls. You will also have to have a pretty good understanding of Corona SDK events. Then you have to know the server side and it’s demands.
First of all, thank you for your answer @Rob. I will try to answer all the things you asked:
Why do I need to log people in? Well, I am creating a private app to make recomendations of Restaurants. Only a little group a people will be able to make recos but all of the rest will be able to read them. So it would be good to valite users.
What features do the get? The authorization function is on the server side. Developed in Java. It will be invoke using REST services. The server only return if the user is valid o not. So true or false.
Do I have an existing web server/database system? Yes I do. All the logic and database are on the server side. The app has a local database (sqlite) to run when it does not have internet connection. The app just make calls to the services.
Am I trying to use some existing web services? Yes, Rest services.
Are you in control of the server side or has someone else built what you’re trying to use? The server side was developed by me and I manage it.
With these answers do you think you could give me any advice?
Well you pretty much will just need network.request() to do the work. Hopefully your host has the information on what you need to do. Some services will use GET paramters on the URL:
Others will use basic authentication, which is a matter of setting the appropriate headers before you make network request with the required login credentials. If it’s a POST call, there is a little bit different way of posting it.
Again, you need to use native.newTextField() to input their username and password. You can look up usage on these two API calls in the documentation listed at the top of the page.
Hi @scerro. This is a very complex issue. Not that any of the individual parts are hard, but that there are too many variables. Why do you need to log people in? What features do the get? Do you have an existing web server/database system? Are you trying to use some existing web service? Are you in control of the server side or has someone else built what you’re trying to use?
Without knowing these answers, it’s going to be really hard to advise you. You can google around for Corona and REST API’s to get a basic understanding of the technology in use. You will be using the network.request(), native.newTextField() and probably display.newText() API calls. You will also have to have a pretty good understanding of Corona SDK events. Then you have to know the server side and it’s demands.
First of all, thank you for your answer @Rob. I will try to answer all the things you asked:
Why do I need to log people in? Well, I am creating a private app to make recomendations of Restaurants. Only a little group a people will be able to make recos but all of the rest will be able to read them. So it would be good to valite users.
What features do the get? The authorization function is on the server side. Developed in Java. It will be invoke using REST services. The server only return if the user is valid o not. So true or false.
Do I have an existing web server/database system? Yes I do. All the logic and database are on the server side. The app has a local database (sqlite) to run when it does not have internet connection. The app just make calls to the services.
Am I trying to use some existing web services? Yes, Rest services.
Are you in control of the server side or has someone else built what you’re trying to use? The server side was developed by me and I manage it.
With these answers do you think you could give me any advice?
Well you pretty much will just need network.request() to do the work. Hopefully your host has the information on what you need to do. Some services will use GET paramters on the URL:
Others will use basic authentication, which is a matter of setting the appropriate headers before you make network request with the required login credentials. If it’s a POST call, there is a little bit different way of posting it.
Again, you need to use native.newTextField() to input their username and password. You can look up usage on these two API calls in the documentation listed at the top of the page.