Posteado por: edeortuzar | 30/06/2017

getCurrentPosition() and watchPosition() are deprecated on insecure origins


If you are using geolocation on Ionic with Crosswalk and you have this error:

getCurrentPosition() and watchPosition() are deprecated on insecure origins

For anyone looking at this problem in the future, the geolocation methods are deprecated in Chromium version 50 and higher.

Which means it affects:

ionic serve if tested on Chrome/Chromium v50+.
Solution: use another browser or older Chromium.

Crosswalk v20 and higher, on device, while using LiveReload
Solution 1: don’t use LiveReload for testing geolocation. It works without it: try ionic run android without -l flag
Solution 2: use older Crosswalk – v19 of Crosswalk is using Chromium v49, i.e. one version before deprecation. This can be achieved by adjusting XWALK_VERSION entry in your config.xml (see also16):

 <plugin name="cordova-plugin-crosswalk-webview" spec="https://github.com/crosswalk-project/cordova-plugin-crosswalk-webview.git">
    <variable name="XWALK_VERSION" value="19"/>
    <variable name="XWALK_LITEVERSION" value="xwalk_core_library_canary:17+"/>
    <variable name="XWALK_COMMANDLINE" value="--disable-pull-to-refresh-effect"/>
    <variable name="XWALK_MODE" value="embedded"/>
    <variable name="XWALK_MULTIPLEAPK" value="true"/>
  </plugin>

This solutions it’s from: https://forum.ionicframework.com/t/geolocation-wont-work-anymore/56687/6

Regards

Anuncios

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión / Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión / Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión / Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión / Cambiar )

Conectando a %s

Categorías

A %d blogueros les gusta esto: