Although obviously the point of Enyo is to be multiplatform, there come times when we need to use platform-specific codes to achieve some things. I've been doing some research into how to determine what platforms we are on, and would appreciate any more tips from anyone else.
To determine if we are in webOS, we can check window.PalmSystem: if(window.PalmSystem) webOSFunction();
To determine if we are running in Phonegap, we can check PhoneGap: if(PhoneGap) phoneGapFunction();
PhoneGap has a "device.platform" property that should return an operating system name, however, it is perhaps less than reliable: it's returns are not completely valid, or necessarily documented -- it returns "iPhone" for all iOS devices, and on several Blackberry devices, it apparently returns a version number of the operating system rather than the name of the system.
0 • •