Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.9.0
-
None
Description
Almost all of the implementations' device plugin does the same thing:
1. On construction, attach to the CordovaReady internal event
2. Inside this event, fire off exec to a "device" service requesting the "getDeviceInfo" action
3. When that info becomes available, assign the device information to the device plugin properties and fire off the CordovaInfoReady event.
The one black sheep in this approach is iOS. iOS instead has the native framework directly call the device plugin's setInfo method (essentially circumventing exec). This is a problem for emulation layers such as Ripple, where exec is the abstraction/hook that needs to be utilized.
May need to implement a few platform-specific merge plugins for device, but the core pattern exists in the common one.