[ 
https://issues.apache.org/jira/browse/CB-9426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14735880#comment-14735880
 ] 

ASF subversion and git services commented on CB-9426:
-----------------------------------------------------

Commit eb976dc650d954c721967e2a26808f1cd15635c5 in 
cordova-plugin-device-orientation's branch refs/heads/master from [~TimBarham]
[ 
https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-device-orientation.git;h=eb976dc
 ]

CB-9426 Fix exception when using device orientation plugin on browser platform.

The plugin's plugin.xml defines a general <js-module> with the name 'compass'. 
It defines another <js-module> for the browser platform (that merges with the 
general module) with the same name. Modules with the same name is not allowed, 
so Cordova throws an exception at runtime when trying to define the browser 
version of the module.

Since the only difference in the browser version of the module is to fake up 
deviceorientation events, I've deleted the browser version and added that logic 
to the general module, with the following change: rather than starting a new 
event timer everytime watchHeading() is called (which could happen multiple 
times resulting in multiple superfluous timers), we have a single event timer 
going as long as there are active watchers.


> Exception using device motion plugin on browser platform
> --------------------------------------------------------
>
>                 Key: CB-9426
>                 URL: https://issues.apache.org/jira/browse/CB-9426
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin Device Motion
>            Reporter: Tim Barham
>            Assignee: Tim Barham
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> When you use the {{device motion}} plugin on the browser platform, you get 
> the following exception:
> {{module cordova-plugin-device-motion.accelerometer already defined}}
> This is because the {{accelerometer}} module name is used twice in plugin.xml.
> Note that exactly the same problem exists for the {{device orientation}} 
> plugin.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to