0

I am modifying an iOS Application, currently application is getting local date and time from iPhone and sending it to SMS/GSM server using Messages Application in the mobile. Currently application is working without internet and we need to keep it working without internet. I can't get the local device time anymore because the user can easily change the device time and send the wrong data. Is there anyway to get Date and Time of SIM card network without Internet access on that device?

I reviewed the following article but it only help getting time through internet and in my case there is no involvement of internet. Get Date and Time from Apple Server

Getting local device time using this code:

let timeFormatter = DateFormatter()
timeFormatter.dateFormat = "MM/dd/yyyy HH:mm:ss"
let currentDateTime :String = timeFormatter.string(from: NSDate() as Date)

I hope there will be some solution.

  • Your best bet is to log the time your server receives the message. Even if you could get the time from the network, the user can edit the text message before it is sent; iOS does not allow an app to send a text message without giving the user the opportunity to edit it, so you can't trust the time that comes from the device. – Paulw11 Jul 17 '19 at 11:11
  • @Paulw11 The text message is encrypted. The Encrypted string contains sender number, location i.e long & lat, and device time. – Umer Farooq Jul 17 '19 at 12:07

0 Answers0