[TIMOB-9298] iOS: Getting uptime value
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-05-30T21:43:41.000+0000 |
Affected Version/s | Release 2.0.1 |
Fix Version/s | Release 2.1.0, Sprint 2012-11 API |
Components | iOS |
Labels | n/a |
Reporter | Mauro Parra-Miranda |
Assignee | Blain Hamon |
Created | 2012-05-29T13:45:36.000+0000 |
Updated | 2017-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-uptimeAttachments
File | Date | Size |
---|---|---|
com.appcelerator.time-iphone-0.1.zip | 2012-05-30T21:41:10.000+0000 | 20811 |
TimeModule.zip | 2012-05-30T21:41:10.000+0000 | 153496 |
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.
Sample module that should suffice.
Sample module provided for the PS team to take over.
Closing ticket due to time passed.