D
D
Dmitry Golovanov2017-10-24 00:47:07
MySQL
Dmitry Golovanov, 2017-10-24 00:47:07

MySql in iOS application. Magic or complex implementation?

Good afternoon.
I'm interested in how you can implement the interaction between an iOS application and a Mysql database.
At the moment, there is an implementation option through a PHP module, which the application accesses through URLSession. But this is not even a crutch, but a trial plug that allows you to get the entire table.
What are the options for working with mysql through queries, or at least how to implement a connection to the database without third-party modules, especially on "puff".
I will be glad to all the options proposed in the answers.
Thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergeyj, 2017-10-24
@golovanovd

Search on request rest api jwt php (well, or another language instead of PHP)
Now, for example, I urgently need to implement a simple API for an iOS application.
In order not to waste time, I took as a basis https://github.com/francescomalatesta/laravel-api-...
This is a RESTful API with JWT authorization.
You are sending json to a specific url (in specific case) POST /api/auth/login

{
  "email":"[email protected]",
  "password":"your_password"
}

In response, you get a token.
To get some information, make a request GET /api/your_route
In the controller, the rights of the token are checked, and if everything is ok, we give the necessary information.
Accordingly, the code on the backend can perform any operation that you wish.
After installing this package, you can check the worker routes php artisan api:routes

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question