How to get current date from server not from device

Hello,
I need the app (game) to check on launch what date it is today. I can’t get it from device because users can manipulate it.
I know nothing about servers and Swift is my first language that I learned (big thanks to this site and all the members). Maybe someone has already done it? Any help much appreciated (:

Hi @minnesota

I suggest you to use some REST API to get current time. For example you could use this service - API Access for Developers - TimeZoneDB.
In order to learn how to connect to a REST API, you could take a look at this tutorial - https://www.raywenderlich.com/157444/updated-course-networking-urlsession.

Hope this is helpful

Nikita

1 Like

This is helpful!
Well, I guess the only thing left is to learn how to send requests. And as far as I figured out that API will respond with JSON and I need to know how to handle it. Looks pretty straight forward.
Thank you so much.

This topic was automatically closed after 166 days. New replies are no longer allowed.