Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9298] iOS: Getting uptime value

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2012-05-30T21:43:41.000+0000
Affected Version/sRelease 2.0.1
Fix Version/sRelease 2.1.0, Sprint 2012-11 API
ComponentsiOS
Labelsn/a
ReporterMauro Parra-Miranda
AssigneeBlain Hamon
Created2012-05-29T13:45:36.000+0000
Updated2017-03-06T22:29:37.000+0000

Description

Problem Description

Customer needs to have a way to detect if the device was restarted (since will require the user to input the password again). We have been thinking that we can get the current time when putting the app to pause (pt), then getting it again on resume event (rt), and if: rt-pt < uptime then the device was restarted.

Extra info

Uptime function is not provided as default, but can be emulated with this: https://github.com/pfeilbr/ios-system-uptime

Attachments

FileDateSize
com.appcelerator.time-iphone-0.1.zip2012-05-30T21:41:10.000+000020811
TimeModule.zip2012-05-30T21:41:10.000+0000153496

Comments

  1. Blain Hamon 2012-05-29

    By the way, iOS provides uptime in an easy manner as of iOS 4.0: +[NSProcessInfo systemUptime]. This should be done in an external module, as there is nothing that requires a change to Titanium core nor other aspects of API to implement.
  2. Blain Hamon 2012-05-30

    Sample module that should suffice.
  3. Blain Hamon 2012-05-30

    Sample module provided for the PS team to take over.
  4. Lee Morris 2017-03-06

    Closing ticket due to time passed.

JSON Source