API or DIRECT DB?

  1. 6 months ago

    ronaldo f

    2 Jun 2019 Pre-Release Testers, Xojo Pro Philippines

    Hi,

    For the 3 years past, I hav'nt tried to create any iOS app because I am enjoying to deliver an app for WEB though many client are asking me if I can produce IOS app.

    Here is my question:

    Assuming my database is MYSQL or MSSQL, for an IOS app, which is best approach to access the database? thru REST API or DIRECT CONNECTION string to database?

    Thank you for the future answer.

    REST API.

    Put something in-between as you have no database driver for iOS.

  2. Christian S

    3 Jun 2019 Pre-Release Testers, Xojo Pro, XDC Speakers, Third Party Store Answer Germany

    REST API.

    Put something in-between as you have no database driver for iOS.

  3. Richard D

    3 Jun 2019 Pre-Release Testers, Xojo Pro Europe (UK, London)

    how to create a rest api to the database server??

  4. Greg O

    3 Jun 2019 Xojo Inc scout.galaxy.barn

    @Richard D how to create a rest api to the database server??

    You create the restapi on the server.

  5. Richard D

    3 Jun 2019 Pre-Release Testers, Xojo Pro Europe (UK, London)

    @Greg OLone You create the restapi on the server.

    sorry... can xojo create restapi and put it on the server???
    i assume it is a console app

  6. Christian S

    3 Jun 2019 Pre-Release Testers, Xojo Pro, XDC Speakers, Third Party Store Germany

    Of course. There are plenty of examples, so go and find them!

  7. Richard K

    3 Jun 2019 Pre-Release Testers, Xojo Pro

    If you can use Airtable rather than MySql there is a great video and sample app on how to connect iOS to Airtable using their API:

    http://developer.xojo.com/webinar-airtable

  8. Steve K

    3 Jun 2019 Pre-Release Testers, Xojo Pro Topeka, KS

    I taught a class at XDC in Miami and gave out example code on how to communicate between and IOS Xojo App and a XojoCloud server with a MySQL database. If you attended XDC you should have access to what you need to get started.

  9. Douglas H

    3 Jun 2019 Pre-Release Testers, Xojo Pro

    @Richard D sorry... can xojo create restapi and put it on the server???
    i assume it is a console app

    One option you should at least look at is Aloe which is can provide a great (and free!) framework for you. But then also look at the Add-Ons section of their downloads page. Specifically Luna Express, designed for making REST interfaces. Or depending on what you need to do, the AirTable support or Key-Value store too.

  10. Richard K

    3 Jun 2019 Pre-Release Testers, Xojo Pro

    Regarding Aloe - it looks interesting, but doesn't that in a way introduce the issue of learning and maintaining code for an additional framework - the very issue that brought many of us to simplify the process with Xojo?

  11. Douglas H

    3 Jun 2019 Pre-Release Testers, Xojo Pro

    In terms of learning, if you look at the example programs and add-ons, the learning curve is very low compared to trying to roll your own solution.

    In terms of maintaining the code, again I'd surmise that dropping in a new Aloe upgrade every now and then would be less work then rolling your own solution.

    Rolling your own can be more educational. But you would likely not implement all the features readily available free in Aloe.

  12. I prefer JSON-RPC to REST because it's protocol agnostic - HTTP, WebSockets or pure TCP.

    I like to include a "service" member as well as the "method" as detailed here , it helps with routing and keeping related methods together.

    So an example request might look like this:

    {
    "id": "abc", // your choice of id
    "service": "seaCargo", // similar to a namespace
    "method": "shipLocation", // the function to call
    "params": ["Seago Bremerhaven"] // the arguments to pass to the function
    }

    And an example response:

    {
    "id": "abc", // for matching the response to a request
    "error": null,
    "result": {"longitude":1.3511000,"latitude":51.9637500}
    }
  13. Jürg O

    3 Jun 2019 Pre-Release Testers, Xojo Pro

    @Richard D how to create a rest api to the database server?

    Have a look at Xojo's Webinars .

  14. 5 months ago

    Sergio T

    Jul 18 Pre-Release Testers, Xojo Pro Europe (Italy, Brescia)

    Newbie

    I'm approaching now to this argument. The first question I have is: How can I be sure no one else (except who uses my app) can access to the "middleware"?

    Thanks in advance.

  15. ronaldo f

    Jul 18 Pre-Release Testers, Xojo Pro Philippines

    You need to provide ACCESS_KEY for each user or group. ACCESS KEY will be part of parameter on pulling data from web service.

    I believed that one of good approach.

  16. Wayne G

    Jul 18 Pre-Release Testers, Xojo Pro Auckland, New Zealand

    I use a consumer key, a consumer secret, a nonce, a timestamp and sign the request with a private key having uploaded the public cert to the provider (my app). And of course this all over SSL.

or Sign Up to reply!