开发者

How to get iPhone model name in Titanium?

开发者 https://www.devze.com 2023-01-26 10:39 出处:网络
I want to know what kind of iPhone is running my app, so I use Titanium.Platform.model to get it. As API documentation, Appcelerator said that Ti.Platform.model will return the model name of current

I want to know what kind of iPhone is running my app, so I use Titanium.Platform.model to get it.

As API documentation, Appcelerator said that Ti.Platform.model will return the model name of current device. But when I try on real iPhone (both 2G, 3G or 4), I see the returned model name is 'iPhone'. But my expected result is 'iPhone 2G' or 'iPhone 4'.

Is the API document wrong? Do we have other solution to determine i开发者_JAVA技巧f current device is iPhone 2G or not?


It does not look like you will ever get 2G back, but you should be getting iPhone 4. take a look at the source code here

0

精彩评论

暂无评论...
验证码 换一张
取 消