The documentation says nothing about possible return values. I have looked for the implementation in the source code, but I am unable to find it.
I wrote a simple application and ran it in the iPhone Simulator, but no value is shown. The application was created by running rhogen app phone_id. I then added the following line to the app/application.rb file just before the call to super:
@phoneId = System.get_property('phone_id')
Then I added this line to app/index.erb:
<p>Phone id = <span><%= @phoneId %></span></p>
I know that the simulator will return a unique identifier because I wrote an actual iOS application that merely writes the unique identifier to a label with the following bit of code:
[idLabel setText:[[UIDevice currentDevice] uniqueIdentifier]];
Since I don’t know Ruby, and I particularly don’t know Rhodes, I am unsure if the Rhodes test application I wrote is working correctly. So, I don’t know if the call to System.get_property is working as it should or if it should really be returning an identifier.
Thus my question, does System.get_property('phone_id') always return a value? If so, is that value guaranteed to be unique? Or are there cases where the method will return nil?
According to messages cb41fb9718773a21 and 0d4ff1aaaaa9e560 on the Rhomobile Google group, this method is not guaranteed to return any value other than
nil. Thus you cannot rely onSystem.get_property('phone_id')to return a unique identifier for your application.