1

I realize this has been asked before, but it has not been adequately answered. I am running phonegap on ios. My deviceready event is firing, but I cannot ever find window.device or device, as in "device.uuid" or "device.model."

It just isn't there. I reference it in the device ready event, yet no luck.

In the safari debugger, it just says 'undefined' is not an object (evaluating 'window.device.uuid')

any help?

stolli
  • 5,580
  • 2
  • 26
  • 37

2 Answers2

4

What version of PhoneGap are you using? If it's 3.0, you'll need to install each device-level API as a plugin.

In the past, I think many of these were readily available out of the box. But with 3.0, I think you need to go and install a plugin for every API you want access to. So there's a separate plugin you need to install to access Accelerometer, Camera, etc... and a separate one for the device object.

I'm still getting adjusted to this (very much a command-line noob), but if you're working with 3.0 this might be your issue.

For more info, see Accessing the Feature, here: http://docs.phonegap.com/en/edge/cordova_device_device.md.html#Device

avoision
  • 1,235
  • 9
  • 14
0

I have used it and it works. Can you post your code?

Also refer to the code: http://docs.phonegap.com/en/edge/cordova_device_device.md.html#device.name

Anup
  • 627
  • 5
  • 19