You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2017/12/14 01:36:47 UTC

[GitHub] stevengill closed pull request #99: CB-13664: remove deprecated platforms

stevengill closed pull request #99: CB-13664: remove deprecated platforms
URL: https://github.com/apache/cordova-plugin-geolocation/pull/99
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/README.md b/README.md
index 7535d94..a212a76 100644
--- a/README.md
+++ b/README.md
@@ -88,13 +88,8 @@ It is also possible to install via repo url directly ( unstable )
 
 ## Supported Platforms
 
-- Amazon Fire OS
 - Android
-- BlackBerry 10
-- Firefox OS
 - iOS
-- Tizen
-- Windows Phone 7 and 8
 - Windows
 
 ## Methods
@@ -310,10 +305,6 @@ It contains a set of properties that describe the geographic coordinates of a po
 
 * __speed__: Current ground speed of the device, specified in meters per second. _(Number)_
 
-###  Amazon Fire OS Quirks
-
-__altitudeAccuracy__: Not supported by Android devices, returning `null`.
-
 ### Android Quirks
 
 __altitudeAccuracy__: Not supported by Android devices, returning `null`.
diff --git a/package.json b/package.json
index 79c4364..2ef9f65 100644
--- a/package.json
+++ b/package.json
@@ -1,20 +1,13 @@
 {
   "name": "cordova-plugin-geolocation",
-  "version": "3.0.1-dev",
+  "version": "4.0.0-dev",
   "description": "Cordova Geolocation Plugin",
   "cordova": {
     "id": "cordova-plugin-geolocation",
     "platforms": [
       "android",
-      "amazon-fireos",
       "ios",
-      "blackberry10",
-      "ubuntu",
-      "wp7",
-      "wp8",
-      "windows8",
-      "windows",
-      "firefoxos"
+      "windows"
     ]
   },
   "repository": {
@@ -29,15 +22,8 @@
     "geolocation",
     "ecosystem:cordova",
     "cordova-android",
-    "cordova-amazon-fireos",
     "cordova-ios",
-    "cordova-blackberry10",
-    "cordova-ubuntu",
-    "cordova-wp7",
-    "cordova-wp8",
-    "cordova-windows8",
-    "cordova-windows",
-    "cordova-firefoxos"
+    "cordova-windows"
   ],
   "scripts": {
     "test": "npm run eslint",
diff --git a/plugin.xml b/plugin.xml
index 457b96a..74da986 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -22,7 +22,7 @@
 xmlns:rim="http://www.blackberry.com/ns/widgets"
 xmlns:android="http://schemas.android.com/apk/res/android"
            id="cordova-plugin-geolocation"
-      version="3.0.1-dev">
+      version="4.0.0-dev">
 
     <name>Geolocation</name>
     <description>Cordova Geolocation Plugin</description>
@@ -61,16 +61,6 @@ xmlns:android="http://schemas.android.com/apk/res/android"
             <runs />
         </js-module>
 
-    </platform>
-
-     <!-- amazon-fireos -->
-    <platform name="amazon-fireos">
-
-        <config-file target="AndroidManifest.xml" parent="/*">
-            <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
-            <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
-        </config-file>
-
     </platform>
 
     <!-- ios -->
@@ -103,113 +93,6 @@ xmlns:android="http://schemas.android.com/apk/res/android"
 
     </platform>
 
-    <!-- blackberry10 -->
-    <platform name="blackberry10">
-
-        <js-module src="www/blackberry10/GeolocationProxy.js" name="GeolocationProxy">
-            <runs />
-        </js-module>
-
-        <js-module src="www/Coordinates.js" name="Coordinates">
-            <clobbers target="Coordinates" />
-        </js-module>
-
-        <js-module src="www/PositionError.js" name="PositionError">
-            <clobbers target="PositionError" />
-        </js-module>
-
-        <js-module src="www/Position.js" name="Position">
-            <clobbers target="Position" />
-        </js-module>
-
-        <js-module src="www/geolocation.js" name="geolocation">
-            <clobbers target="navigator.geolocation" />
-        </js-module>
-
-        <config-file target="www/config.xml" parent="/widget">
-            <feature name="Geolocation" value="Geolocation"/>
-        </config-file>
-
-        <config-file target="www/config.xml" parent="/widget/rim:permissions">
-          <rim:permit>read_geolocation</rim:permit>
-        </config-file>
-
-    </platform>
-
-    <!-- ubuntu -->
-    <platform name="ubuntu">
-        <js-module src="www/Coordinates.js" name="Coordinates">
-            <clobbers target="Coordinates" />
-        </js-module>
-
-        <js-module src="www/PositionError.js" name="PositionError">
-            <clobbers target="PositionError" />
-        </js-module>
-
-        <js-module src="www/Position.js" name="Position">
-            <clobbers target="Position" />
-        </js-module>
-
-        <js-module src="www/geolocation.js" name="geolocation">
-            <clobbers target="navigator.geolocation" />
-        </js-module>
-
-        <source-file src="src/ubuntu/geolocation.cpp" />
-        <header-file src="src/ubuntu/geolocation.h" />
-        <config-file target="config.xml" parent="/*">
-            <feature name="Geolocation">
-                <param policy_group="location" policy_version="1" />
-            </feature>
-        </config-file>
-    </platform>
-
-    <!-- wp7 -->
-    <platform name="wp7">
-
-        <config-file target="Properties/WMAppManifest.xml" parent="/Deployment/App/Capabilities">
-            <Capability Name="ID_CAP_LOCATION" />
-        </config-file>
-
-        <source-file src="src/wp/Geolocation.cs" />
-    </platform>
-
-    <!-- wp8 -->
-    <platform name="wp8">
-
-        <config-file target="Properties/WMAppManifest.xml" parent="/Deployment/App/Capabilities">
-            <Capability Name="ID_CAP_LOCATION" />
-        </config-file>
-
-        <source-file src="src/wp/Geolocation.cs" />
-    </platform>
-
-    <!-- windows8 -->
-    <platform name="windows8">
-        <config-file target="package.appxmanifest" parent="/Package/Capabilities">
-            <DeviceCapability Name="location" />
-        </config-file>
-
-        <js-module src="src/windows/GeolocationProxy.js" name="GeolocationProxy">
-            <runs />
-        </js-module>
-
-        <js-module src="www/Coordinates.js" name="Coordinates">
-            <clobbers target="Coordinates" />
-        </js-module>
-
-        <js-module src="www/PositionError.js" name="PositionError">
-            <clobbers target="PositionError" />
-        </js-module>
-
-        <js-module src="www/Position.js" name="Position">
-            <clobbers target="Position" />
-        </js-module>
-
-        <js-module src="www/geolocation.js" name="geolocation">
-            <clobbers target="navigator.geolocation" />
-        </js-module>
-    </platform>
-
     <!-- windows universal apps (Windows 8.1, Windows Phone 8.1, Windows 8.0) -->
     <platform name="windows">
         <config-file target="package.appxmanifest" parent="/Package/Capabilities">
@@ -236,31 +119,4 @@ xmlns:android="http://schemas.android.com/apk/res/android"
             <clobbers target="navigator.geolocation" />
         </js-module>
     </platform>
-
-    <!-- firefoxos -->
-    <platform name="firefoxos">
-      <config-file target="config.xml" parent="/*">
-          <permission name="geolocation" description="Required for accessing user location." />
-      </config-file>
-
-        <js-module src="src/firefoxos/GeolocationProxy.js" name="GeolocationProxy">
-            <runs />
-        </js-module>
-
-        <js-module src="www/Coordinates.js" name="Coordinates">
-            <clobbers target="Coordinates" />
-        </js-module>
-
-        <js-module src="www/PositionError.js" name="PositionError">
-            <clobbers target="PositionError" />
-        </js-module>
-
-        <js-module src="www/Position.js" name="Position">
-            <clobbers target="Position" />
-        </js-module>
-
-        <js-module src="www/geolocation.js" name="geolocation">
-            <clobbers target="navigator.geolocation" />
-        </js-module>
-    </platform>
 </plugin>
diff --git a/src/firefoxos/GeolocationProxy.js b/src/firefoxos/GeolocationProxy.js
deleted file mode 100644
index 598f705..0000000
--- a/src/firefoxos/GeolocationProxy.js
+++ /dev/null
@@ -1,67 +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.
- *
-*/
-
-// latest geolocation spec can be found here: http://www.w3.org/TR/geolocation-API/
-
-var idsMap = {};
-
-module.exports = {
-    getLocation: function (success, error, args) {
-        var geo = cordova.require('cordova/modulemapper').getOriginalSymbol(window, 'navigator.geolocation'); // eslint-disable-line no-undef
-        function successCallback (position) {
-            // Cordova is creating Position object using just coords
-            success(position.coords);
-        }
-        geo.getCurrentPosition(successCallback, error, {
-            enableHighAccuracy: args[0],
-            maximumAge: args[1]
-        });
-    },
-
-    addWatch: function (success, error, args) {
-        var geo = cordova.require('cordova/modulemapper').getOriginalSymbol(window, 'navigator.geolocation'); // eslint-disable-line no-undef
-        var id = args[0];
-        function successCallback (position) {
-            success(position.coords);
-        }
-        var nativeId = geo.watchPosition(successCallback, error, {
-            enableHighAccuracy: args[1]
-        });
-
-        idsMap[id] = nativeId;
-    },
-
-    clearWatch: function (success, error, args) {
-        var geo = cordova.require('cordova/modulemapper').getOriginalSymbol(window, 'navigator.geolocation'); // eslint-disable-line no-undef
-        var id = args[0];
-
-        if (id in idsMap) {
-            geo.clearWatch(idsMap[id]);
-            delete idsMap[id];
-        }
-
-        if (success) {
-            success();
-        }
-    }
-};
-
-require('cordova/exec/proxy').add('Geolocation', module.exports);
diff --git a/src/ubuntu/geolocation.cpp b/src/ubuntu/geolocation.cpp
deleted file mode 100644
index 3d40ab4..0000000
--- a/src/ubuntu/geolocation.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- *
- * Copyright 2013-2016 Canonical Ltd.
- *
- * 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.
- *
-*/
-
-#include <QUuid>
-
-#include "geolocation.h"
-
-Geolocation::Geolocation(Cordova *cordova)
-  : CPlugin(cordova),
-    _geoPositionInfoSource(QGeoPositionInfoSource::createDefaultSource(this)) {
-    if (_geoPositionInfoSource.data() != 0) {
-        QObject::connect(_geoPositionInfoSource.data(),
-                         SIGNAL(positionUpdated(QGeoPositionInfo)),
-                         this,
-                         SLOT(positionUpdated(QGeoPositionInfo)));
-        
-        QObject::connect(_geoPositionInfoSource.data(),
-                         SIGNAL(updateTimeout()),
-                         this,
-                         SLOT(updateTimeout()));
-    }
-}
-
-void Geolocation::addWatch(int scId, int ecId, const QString &id, bool enableHighAccuracy) {
-    Q_UNUSED(enableHighAccuracy);
-
-    assert(_id2sc.find(id) == _id2sc.end());
-
-    if (!_geoPositionInfoSource.data()) {
-        QVariantMap err;
-        err.insert("code", POSITION_UNAVAILABLE);
-        err.insert("message", "unavailable");
-
-        this->cb(ecId, err);
-        return;
-    }
-
-    _id2sc[id] = scId;
-    _id2ec[id] = ecId;
-}
-
-void Geolocation::clearWatch(int scId, int ecId, const QString &id) {
-    _id2sc.remove(id);
-    _id2ec.remove(id);
-}
-
-void Geolocation::getLocation(int scId, int ecId, bool enableHighAccuracy, qint64 maximumAge) {
-    Q_UNUSED(maximumAge);
-    Q_UNUSED(enableHighAccuracy);
-
-    if (!_geoPositionInfoSource.data()) {
-        QVariantMap err;
-        err.insert("code", POSITION_UNAVAILABLE);
-        err.insert("message", "unavailable");
-
-        this->cb(ecId, err);
-        return;
-    }
-
-    _geoPositionInfoSource->requestUpdate();
-
-    QString id = QString("_INTERNAL_") + QUuid::createUuid().toString();
-
-    _id2sc[id] = scId;
-    _id2ec[id] = ecId;
-    _singleUpdate.insert(id);
-}
-
-void Geolocation::positionUpdated(const QGeoPositionInfo &update) {
-    QGeoCoordinate coordinate = update.coordinate();
-
-    QVariantMap p;
-
-    p.insert("latitude", coordinate.latitude());
-    p.insert("longitude", coordinate.longitude());
-
-    if (coordinate.type() == QGeoCoordinate::Coordinate3D)
-      p.insert("altitude", coordinate.altitude());
-
-    if (update.hasAttribute(QGeoPositionInfo::HorizontalAccuracy))
-        p.insert("accuracy", update.attribute(QGeoPositionInfo::HorizontalAccuracy));
-
-    if (update.hasAttribute(QGeoPositionInfo::Direction))
-        p.insert("heading", update.attribute(QGeoPositionInfo::Direction));
-
-    if (update.hasAttribute(QGeoPositionInfo::GroundSpeed))
-        p.insert("velocity", update.attribute(QGeoPositionInfo::GroundSpeed));
-
-    if (update.hasAttribute(QGeoPositionInfo::VerticalAccuracy))
-        p.insert("altitudeAccuracy", update.attribute(QGeoPositionInfo::VerticalAccuracy));
-
-    p.insert("timestamp", update.timestamp().toMSecsSinceEpoch());
-
-    for (const QString &id: _id2sc.keys()) {
-        int scId = _id2sc[id];
-        this->cb(scId, p);
-        if (_singleUpdate.contains(id)) {
-            _singleUpdate.remove(id);
-            _id2sc.remove(id);
-            _id2ec.remove(id);
-        }
-    }
-}
-
-void Geolocation::updateTimeout() {
-    QVariantMap err;
-    err.insert("code", TIMEOUT);
-    err.insert("message", "timeout");
-
-    for (int ecId: _id2ec) {
-        this->cb(ecId, err);
-    }
-
-    _id2ec.clear();
-    _id2sc.clear();
-    _singleUpdate.clear();
-}
diff --git a/src/ubuntu/geolocation.h b/src/ubuntu/geolocation.h
deleted file mode 100644
index 7345bec..0000000
--- a/src/ubuntu/geolocation.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- *
- * Copyright 2013 Canonical Ltd.
- *
- * 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.
- *
-*/
-
-#ifndef GEOLOCATION_H_SVO2013
-#define GEOLOCATION_H_SVO2013
-
-#include <QGeoPositionInfoSource>
-#include <QGeoPositionInfo>
-#include <QtCore>
-#include <cassert>
-
-#include <cplugin.h>
-
-class Geolocation: public CPlugin {
-    Q_OBJECT
-public:
-    explicit Geolocation(Cordova *cordova);
-
-    virtual const QString fullName() override {
-        return Geolocation::fullID();
-    }
-
-    virtual const QString shortName() override {
-        return "Geolocation";
-    }
-
-    static const QString fullID() {
-        return "Geolocation";
-    }
-
-public slots:
-    void getLocation(int scId, int ecId, bool enableHighAccuracy, qint64 maximumAge);
-    void addWatch(int scId, int ecId, const QString &id, bool enableHighAccuracy);
-    void clearWatch(int scId, int ecId, const QString &id);
-
-protected slots:
-    void positionUpdated(const QGeoPositionInfo &update);
-    void updateTimeout();
-
-private:
-    QMap<QString, int> _id2sc;
-    QMap<QString, int> _id2ec;
-    QSet<QString> _singleUpdate;
-    QSharedPointer<QGeoPositionInfoSource> _geoPositionInfoSource;
-
-    enum PositionError {
-        PERMISSION_DENIED = 1,
-        POSITION_UNAVAILABLE = 2,
-        TIMEOUT = 3
-    };
-};
-
-#endif
diff --git a/src/wp/GeoLocation.cs b/src/wp/GeoLocation.cs
deleted file mode 100644
index 42af72d..0000000
--- a/src/wp/GeoLocation.cs
+++ /dev/null
@@ -1,34 +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.Collections.Generic;
-using System.Runtime.Serialization;
-using System.Threading;
-using System.Device.Location;
-
-namespace WPCordovaClassLib.Cordova.Commands
-{
-    /// <summary>
-    /// This is a command stub, the browser provides the correct implementation.  We use this to trigger the static analyzer that we require this permission 
-    /// </summary>
-    public class Geolocation
-    {
-        /* Unreachable code, by design -jm */
-        private void triggerGeoInclusion()
-        {
-            new GeoCoordinateWatcher();
-        }
-    }
-}
diff --git a/www/blackberry10/GeolocationProxy.js b/www/blackberry10/GeolocationProxy.js
deleted file mode 100644
index 476d84f..0000000
--- a/www/blackberry10/GeolocationProxy.js
+++ /dev/null
@@ -1,69 +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 idsMap = {};
-var geo = cordova.require('cordova/modulemapper').getOriginalSymbol(window, 'navigator.geolocation'); // eslint-disable-line no-undef
-
-module.exports = {
-
-    getLocation: function (success, error, args) {
-        var successCallback = function (result) {
-            var pos = result.coords;
-            pos.timestamp = result.timestamp;
-            if (success) {
-                success(pos);
-            }
-        };
-        geo.getCurrentPosition(successCallback, error, {
-            enableHighAccuracy: args[0],
-            maximumAge: args[1]
-        });
-    },
-
-    addWatch: function (success, error, args) {
-        var id = args[0];
-        var successCallback = function (result) {
-            var pos = result.coords;
-            pos.timestamp = result.timestamp;
-            if (success) {
-                success(pos);
-            }
-        };
-        var nativeId = geo.watchPosition(successCallback, error, {
-            enableHighAccuracy: args[1]
-        });
-        idsMap[id] = nativeId;
-    },
-
-    clearWatch: function (success, error, args) {
-        var id = args[0];
-        if (id in idsMap) {
-            geo.clearWatch(idsMap[id]);
-            delete idsMap[id];
-        }
-        if (success) {
-            success();
-        }
-    }
-
-};
-
-require('cordova/exec/proxy').add('Geolocation', module.exports);


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org