CordovaFirefoxOS
Jump to navigation
Jump to search
This page is to document the development of Cordova for FirefoxOS. It is edited quite often, co
General issues
- Cordova rewrites the navigator object.
- The temporary solution is to comment out https://github.com/apache/cordova-js/blob/master/lib/scripts/bootstrap.js#L67. This implies more issues, especially firing several events needs to be forced.
- It is no longer the case for FirefoxOS 1.2.0. Further investigation is needed as onCordovaConnectionReady is still not fired.
Comparing APIs
Cordova | FirefoxOS | Differences |
---|---|---|
Accelerometer | devicemotion, DeviceMotionEvent.acceleration | Cordova provides getCurrentAcceleration and watchAcceleration . This is easy to simulate using DeviceMotionEvent . getCurrentAcceleration will simply call it once and clear the watcher afterwards. The only advantage will be the acceleratorOptions which contains frequency property. There is also a timestamp property returned to Cordova's callback.
|
Camera | WebActivities, Pick image example | FirefoxOS is providing access to pictures via WebActivities. Usage is fairly simple and an example is already working. However full support of Cordova API will be hard (or impossible) to implement. The problematic parts are specified in cameraOptions:
|
Capture | WebActivities | The main differences are in the object returned to the callbacks, some on-the-fly transition will be needed. |
Compass | deviceorientation | FirefoxOS provides support as an event. Use absolute parameter to check if the device is able to provide the Earth coordinate frame
|
Connection | navigator.connection | Cordova has a different object under the same navigator property name. FirefoxOS doesn't provide type of the connection to the apps. According to Harald' answer on StackOverflow "metered should be enough to tell if the user is on wifi".
|
Contacts | WebAPI/ContactsAPI | There are lacks in FxOS documentation of Contact fields (impp , url , address ). Some fields are not exactly corresponding to each other. FxOS has an ability to save only one organization. Cordova has no info about (anniversary , sex , genderIdentity )
|
Device | As for the moment FxOS does not provide any info about device to not certified apps. Following properties of device object will not returned: name , uuid , version , model
| |
Events | TBD (some of these will require a separate row in this table) | |
File | TBD | |
Geolocation | Using geolocation | The only difference is providing a timestamp as Date object |
Globalization | TBD | |
InAppBrowser | TBD | |
Media | TBD | |
Notification.alert | window.alert | There is a need for a new function which will be asynchronous and support changing title and buttonName
|
Notification.confirm | window.confirm | There is a need for a new function which will be asynchronous and support changing title and buttonLabels
|
Notification.prompt | window.prompt | There is a need for a new function which will be asynchronous and support changing title and buttonLabels
|
Notification.beep | TBD | |
Notification.vibrate | Vibration | None |
Splashscreen | TBD | |
Storage | TBD |