diff --git a/README.md b/README.md
index 6c76309..f8f9eda 100644
--- a/README.md
+++ b/README.md
@@ -60,26 +60,14 @@
 
 ### Supported Platforms
 
-- Amazon Fire OS
 - iOS
 - Android
-- BlackBerry 10
-- Windows Phone 7 and 8
-- Windows (Windows Phone 8.1 and Windows 10)
-- Firefox OS
+- Windows
 - Browser (Chrome, Firefox, Opera)
 
-### Quirks: Android &amp; Amazon Fire OS
+### Quirks: Android
 
-**Warning**: the Android and Fire OS implementations are greedy and prolonged use will drain the device's battery.
-
-### Quirks: Windows Phone 7 &amp; Windows Phone 8
-
-The `level` property is _not_ supported on Windows Phone 7 because the OS does not provide native APIs to determine battery level. The `isPlugged` parameter _is_ supported.
-
-### Quirks: Windows Phone 8.1
-
-The `isPlugged` parameter is _not_ supported on Windows Phone 8.1. The `level` parameter _is_ supported.
+**Warning**: the Android implementation is greedy and prolonged use will drain the device's battery.
 
 ## batterylow event
 
@@ -95,18 +83,11 @@
 
 ### Supported Platforms
 
-- Amazon Fire OS
 - iOS
 - Android
-- BlackBerry 10
-- Firefox OS
-- Windows (Windows Phone 8.1 and Windows 10)
+- Windows
 - Browser (Chrome, Firefox, Opera)
 
-### Quirks: Windows Phone 8.1
-
-The `batterylow` event fires on Windows Phone 8.1 irrespective of whether the device is plugged in or not. This happens because the OS does not provide an API to detect whether the device is plugged in.
-
 ## batterycritical event
 
 Fires when the battery charge percentage reaches the critical charge threshold. This threshold value is device-specific. Returns an [object][status_object] containing battery status.
@@ -121,17 +102,11 @@
 
 ### Supported Platforms
 
-- Amazon Fire OS
 - iOS
 - Android
-- BlackBerry 10
-- Firefox OS
-- Windows (Windows Phone 8.1 and Windows 10)
+- Windows
 - Browser (Chrome, Firefox, Opera)
 
-### Quirks: Windows Phone 8.1
-
-The `batterycritical` event fires on Windows Phone 8.1 irrespective of whether the device is plugged in or not. This happens because the OS does not provide an API to detect whether the device is plugged in.
 
 [w3c_spec]: http://www.w3.org/TR/2011/WD-battery-status-20110915/
 [status_object]: #status-object
diff --git a/package.json b/package.json
index 24d80e0..73447f3 100644
--- a/package.json
+++ b/package.json
@@ -1,20 +1,15 @@
 {
   "name": "cordova-plugin-battery-status",
-  "version": "1.2.6-dev",
+  "version": "2.0.0-dev",
   "description": "Cordova Battery Plugin",
   "types": "./types/index.d.ts",
   "cordova": {
     "id": "cordova-plugin-battery-status",
     "platforms": [
       "android",
-      "amazon-fireos",
-      "ubuntu",
       "ios",
-      "blackberry10",
-      "wp7",
-      "wp8",
-      "tizen",
-      "firefoxos"
+      "browser",
+      "windows"
     ]
   },
   "repository": {
@@ -29,14 +24,7 @@
     "battery",
     "ecosystem:cordova",
     "cordova-android",
-    "cordova-amazon-fireos",
-    "cordova-ubuntu",
-    "cordova-ios",
-    "cordova-blackberry10",
-    "cordova-wp7",
-    "cordova-wp8",
-    "cordova-tizen",
-    "cordova-firefoxos"
+    "cordova-ios"
   ],
   "scripts": {
     "test": "npm run eslint",
diff --git a/plugin.xml b/plugin.xml
index 39d1596..3c15e77 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -20,7 +20,7 @@
 
 <plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
       id="cordova-plugin-battery-status"
-      version="1.2.6-dev">
+      version="2.0.0-dev">
     <name>Battery</name>
     <description>Cordova Battery Plugin</description>
     <license>Apache 2.0</license>
@@ -43,23 +43,6 @@
         <source-file src="src/android/BatteryListener.java" target-dir="src/org/apache/cordova/batterystatus" />
     </platform>
 
-    <!-- amazon-fireos -->
-    <platform name="amazon-fireos">
-        <config-file target="res/xml/config.xml" parent="/*">
-            <feature name="Battery" >
-                <param name="android-package" value="org.apache.cordova.batterystatus.BatteryListener"/>
-            </feature>
-        </config-file>
-
-        <source-file src="src/android/BatteryListener.java" target-dir="src/org/apache/cordova/batterystatus" />
-    </platform>
-
-    <!-- ubuntu -->
-    <platform name="ubuntu">
-        <header-file src="src/ubuntu/battery.h" />
-        <source-file src="src/ubuntu/battery.cpp" />
-    </platform>
-
     <!-- ios -->
     <platform name="ios">
         <config-file target="config.xml" parent="/*">
@@ -71,36 +54,6 @@
 	    <source-file src="src/ios/CDVBattery.m" />
     </platform>
 
-    <!-- blackberry10 -->
-    <platform name="blackberry10">
-    <source-file src="src/blackberry10/index.js" target-dir="Battery" />
-        <config-file target="www/config.xml" parent="/widget">
-            <feature name="Battery" value="Battery"/>
-        </config-file>
-    </platform>
-
-    <!-- wp7 -->
-    <platform name="wp7">
-        <config-file target="config.xml" parent="/*">
-            <feature name="Battery">
-                <param name="wp-package" value="Battery"/>
-            </feature>
-        </config-file>
-
-        <source-file src="src/wp/Battery.cs" />
-    </platform>
-
-    <!-- wp8 -->
-    <platform name="wp8">
-        <config-file target="config.xml" parent="/*">
-            <feature name="Battery">
-                <param name="wp-package" value="Battery"/>
-            </feature>
-        </config-file>
-
-        <source-file src="src/wp/Battery.cs" />
-    </platform>
-
     <!-- windows -->
     <platform name="windows">
         <js-module src="src/windows/BatteryProxy.js" name="Battery">
@@ -110,20 +63,6 @@
         <framework src="src/windows/BatteryStatus.winmd" custom="true" target="phone"/>
     </platform>
 
-    <!-- tizen -->
-    <platform name="tizen">
-        <js-module src="src/tizen/BatteryStatusProxy.js" name="BatteryStatusProxy">
-            <runs/>
-        </js-module>
-    </platform>
-
-    <!-- firefoxos -->
-    <platform name="firefoxos">
-        <js-module src="src/firefoxos/BatteryProxy.js" name="Battery">
-            <runs />
-        </js-module>
-    </platform>
-
     <!-- browser -->
     <platform name="browser">
         <js-module src="src/browser/BatteryProxy.js" name="Battery">
diff --git a/src/blackberry10/index.js b/src/blackberry10/index.js
deleted file mode 100644
index 995908d..0000000
--- a/src/blackberry10/index.js
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/* global PluginResult */
-
-var _clientListeners = {};
-var _webkitBattery = navigator.webkitBattery || navigator.battery;
-
-module.exports = {
-    start: function (success, fail, args, env) {
-        var result = new PluginResult(args, env);
-        var listener = function (info) {
-            var resultInfo = {};
-            if (info) {
-                if (info.srcElement) {
-                    // webkitBattery listeners store webkitBattery in srcElement object
-                    info = info.srcElement;
-                }
-
-                // put data from webkitBattery into a format cordova expects
-                // webkitBattery seems to return level as a decimal pre 10.2
-                resultInfo.level = info.level <= 1 ? info.level * 100 : info.level;
-                resultInfo.isPlugged = info.charging;
-            }
-
-            result.callbackOk(resultInfo, true);
-        };
-
-        if (_clientListeners[env.webview.id]) {
-            // TODO: Change back to erroring out after reset is implemented
-            // result.error("Battery listener already running");
-            _webkitBattery.onchargingchange = null;
-            _webkitBattery.onlevelchange = null;
-        }
-
-        _clientListeners[env.webview.id] = listener;
-
-        _webkitBattery.onchargingchange = listener;
-        _webkitBattery.onlevelchange = listener;
-
-        setTimeout(function () {
-            // Call callback with webkitBattery data right away
-            listener(_webkitBattery);
-        });
-
-        result.noResult(true);
-    },
-    stop: function (success, fail, args, env) {
-        var result = new PluginResult(args, env);
-        var listener = _clientListeners[env.webview.id];
-
-        if (!listener) {
-            result.error('Battery listener has not started');
-        } else {
-            _webkitBattery.onchargingchange = null;
-            _webkitBattery.onlevelchange = null;
-            delete _clientListeners[env.webview.id];
-            result.noResult(false);
-        }
-    }
-};
diff --git a/src/firefoxos/BatteryProxy.js b/src/firefoxos/BatteryProxy.js
deleted file mode 100644
index 98a76a1..0000000
--- a/src/firefoxos/BatteryProxy.js
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-var mozBattery = cordova.require('cordova/modulemapper').getOriginalSymbol(window, 'navigator.battery') || navigator.mozBattery; // eslint-disable-line no-undef
-
-var Battery = {
-    start: function (successCB, failCB, args, env) {
-        if (mozBattery) {
-            Battery.attachListeners(successCB);
-        } else {
-            failCB('Could not get window.navigator.battery');
-        }
-    },
-
-    stop: function () {
-        Battery.detachListeners();
-    },
-
-    attachListeners: function (_callBack) {
-
-        Battery.updateBatteryStatus(_callBack); // send a battery status event
-
-        mozBattery.addEventListener('chargingchange', function () {
-            _callBack({level: (mozBattery.level * 100), isPlugged: mozBattery.charging});
-        });
-
-        mozBattery.addEventListener('levelchange', function () {
-            _callBack({level: (mozBattery.level * 100), isPlugged: mozBattery.charging});
-        });
-    },
-
-    detachListeners: function () {
-
-        mozBattery.removeEventListener('chargingchange', null);
-        mozBattery.removeEventListener('levelchange', null);
-    },
-
-    updateBatteryStatus: function (_callBack) {
-        _callBack({level: (mozBattery.level * 100), isPlugged: mozBattery.charging});
-    }
-};
-
-require('cordova/exec/proxy').add('Battery', Battery);
diff --git a/src/tizen/BatteryStatusProxy.js b/src/tizen/BatteryStatusProxy.js
deleted file mode 100644
index 56feabc..0000000
--- a/src/tizen/BatteryStatusProxy.js
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/* global tizen */
-
-var batteryListenerId = null;
-
-module.exports = {
-    start: function (successCallback, errorCallback) {
-        var batterySuccessCallback = function (power) {
-            if (successCallback) {
-                successCallback({level: Math.round(power.level * 100), isPlugged: power.isCharging});
-            }
-        };
-
-        if (batteryListenerId === null) {
-            batteryListenerId = tizen.systeminfo.addPropertyValueChangeListener('BATTERY', batterySuccessCallback);
-        }
-
-        tizen.systeminfo.getPropertyValue('BATTERY', batterySuccessCallback, errorCallback);
-    },
-
-    stop: function (successCallback, errorCallback) {
-        tizen.systeminfo.removePropertyValueChangeListener(batteryListenerId);
-        batteryListenerId = null;
-    }
-};
-
-require('cordova/tizen/commandProxy').add('Battery', module.exports);
diff --git a/src/ubuntu/battery.cpp b/src/ubuntu/battery.cpp
deleted file mode 100644
index f3b8f80..0000000
--- a/src/ubuntu/battery.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-#include <QtCore>
-
-#include "battery.h"
-
-BatteryStatus::BatteryStatus(Cordova *cordova) : CPlugin(cordova) {
-    _scId = 0;
-
-    connect(&_batteryInfo, SIGNAL(remainingCapacityChanged(int,int)), this, SLOT(remainingCapacityChanged(int,int)));
-    connect(&_batteryInfo, SIGNAL(chargerTypeChanged(QBatteryInfo::ChargerType)), this, SLOT(chargerTypeChanged(QBatteryInfo::ChargerType)));
-}
-
-void BatteryStatus::remainingCapacityChanged(int battery, int capacity) {
-    Q_UNUSED(battery);
-    Q_UNUSED(capacity);
-
-    fireEvents();
-}
-
-void BatteryStatus::chargerTypeChanged(QBatteryInfo::ChargerType type) {
-    Q_UNUSED(type);
-
-    fireEvents();
-}
-
-void BatteryStatus::fireEvents() {
-    int fullCount = 0;
-    bool isPlugged = false;
-
-    int remaining = 0, total = 0;
-    for (int i = 0; i < _batteryInfo.batteryCount(); i++) {
-        isPlugged = (_batteryInfo.chargingState(i) == QBatteryInfo::Charging) || isPlugged;
-        fullCount += _batteryInfo.chargingState(i) == QBatteryInfo::Full;
-
-        remaining += _batteryInfo.remainingCapacity(i);
-        total += _batteryInfo.maximumCapacity(i);
-    }
-
-    isPlugged = isPlugged || (_batteryInfo.batteryCount() == fullCount);
-
-    if (_scId) {
-        QVariantMap obj;
-        obj.insert("isPlugged", (int)isPlugged);
-        if (total != 0)
-          obj.insert("level", remaining * 100 / total);
-        else
-          obj.insert("level", 100);
-
-        this->callbackWithoutRemove(_scId, CordovaInternal::format(obj));
-    }
-}
-
-void BatteryStatus::start(int scId, int) {
-    _scId = scId;
-}
-
-void BatteryStatus::stop(int, int) {
-    _scId = 0;
-}
diff --git a/src/ubuntu/battery.h b/src/ubuntu/battery.h
deleted file mode 100644
index cec7856..0000000
--- a/src/ubuntu/battery.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-#ifndef BATTERY_H_AAAAAAAA
-#define BATTERY_H_AAAAAAAA
-
-#include <QBatteryInfo>
-
-#include <cplugin.h>
-
-class BatteryStatus: public CPlugin {
-    Q_OBJECT
-public:
-    explicit BatteryStatus(Cordova *cordova);
-
-    virtual const QString fullName() override {
-        return BatteryStatus::fullID();
-    }
-
-    virtual const QString shortName() override {
-        return "Battery";
-    }
-
-    static const QString fullID() {
-        return "Battery";
-    }
-
-public slots:
-    void start(int scId, int ecId);
-    void stop(int scId, int ecId);
-
-private slots:
-    void remainingCapacityChanged(int battery, int capacity);
-    void chargerTypeChanged(QBatteryInfo::ChargerType type);
-    void onlineStatusChanged(bool isOnline);
-
-private:
-    void fireEvents();
-
-    QBatteryInfo _batteryInfo;
-
-    int _scId;
-};
-
-#endif
diff --git a/src/wp/Battery.cs b/src/wp/Battery.cs
deleted file mode 100644
index 219d8ff..0000000
--- a/src/wp/Battery.cs
+++ /dev/null
@@ -1,104 +0,0 @@
-﻿/*  
-	Licensed under the Apache License, Version 2.0 (the "License");
-	you may not use this file except in compliance with the License.
-	You may obtain a copy of the License at
-	
-	http://www.apache.org/licenses/LICENSE-2.0
-	
-	Unless required by applicable law or agreed to in writing, software
-	distributed under the License is distributed on an "AS IS" BASIS,
-	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-	See the License for the specific language governing permissions and
-	limitations under the License.
-*/
-
-using System;
-using System.Net;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Documents;
-using System.Windows.Ink;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Animation;
-using System.Windows.Shapes;
-
-using Microsoft.Phone.Info;
-
-namespace WPCordovaClassLib.Cordova.Commands
-{
-    /// <summary>
-    /// Listens for changes to the state of the battery on the device.
-    /// </summary>
-    public class Battery : BaseCommand
-    {
-        private bool isPlugged = false;
-        private EventHandler powerChanged;
-#if WP8
-        private Windows.Phone.Devices.Power.Battery battery;
-#endif
-        public Battery()
-        {
-            powerChanged = new EventHandler(DeviceStatus_PowerSourceChanged);
-            isPlugged = DeviceStatus.PowerSource.ToString().CompareTo("External") == 0;
-
-#if WP8
-            battery = Windows.Phone.Devices.Power.Battery.GetDefault();
-#endif
-        }
-
-        public void start(string options)
-        {
-            // Register power changed event handler
-            DeviceStatus.PowerSourceChanged += powerChanged;
-
-#if WP8
-            battery.RemainingChargePercentChanged += Battery_RemainingChargePercentChanged;
-#endif
-
-            PluginResult result = new PluginResult(PluginResult.Status.NO_RESULT);
-            result.KeepCallback = true;
-            DispatchCommandResult(result);
-        }
-        public void stop(string options)
-        {
-            // Unregister power changed event handler
-            DeviceStatus.PowerSourceChanged -= powerChanged;
-#if WP8
-            battery.RemainingChargePercentChanged -= Battery_RemainingChargePercentChanged;
-#endif
-        }
-
-        private void DeviceStatus_PowerSourceChanged(object sender, EventArgs e)
-        {
-            isPlugged = DeviceStatus.PowerSource.ToString().CompareTo("External") == 0;
-            PluginResult result = new PluginResult(PluginResult.Status.OK, GetCurrentBatteryStateFormatted());
-            result.KeepCallback = true;
-            DispatchCommandResult(result);
-        }
-
-        private void Battery_RemainingChargePercentChanged(object sender, object e)
-        {
-            PluginResult result = new PluginResult(PluginResult.Status.OK, GetCurrentBatteryStateFormatted());
-            result.KeepCallback = true;
-            DispatchCommandResult(result);
-        }
-
-        private string GetCurrentBatteryStateFormatted()
-        {
-            int remainingChargePercent = -1;
-#if WP8
-            remainingChargePercent = battery.RemainingChargePercent;
-#endif
-
-
-            string batteryState = String.Format("\"level\":{0},\"isPlugged\":{1}",
-                                                    remainingChargePercent,
-                                                    isPlugged ? "true" : "false"
-                            );
-            batteryState = "{" + batteryState + "}";
-            return batteryState;
-        }
-
-    }
-}
