Software Archive
Read-only legacy content
17061 Discussions

GEOLOCATION IOS

Emre_C_1
Novice
412 Views

Dear all,

I've created an application to get user position via below functions.

It's working on Intel XDK and Android App preview but does not working on IOS app preview.

It mus be related with permissions but I didn't find a solution.

 

function initiate_geolocation() {
            navigator.geolocation.getCurrentPosition(handle_geolocation_query);
    }
 
 function handle_geolocation_query(position){
            alert('Lat: ' + position.coords.latitude + ' ' +
                    'Lon: ' + position.coords.longitude);
    }

 

My IOS config file.

<?xml version='1.0' encoding='UTF-8'?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:intelxdk="http://xdk.intel.com/ns/v1" id="xdk.intel.blank.ad.template" version="0.0.1">
<!--This file is generated by the Intel XDK. Do not edit this file as your edits will be lost.           -->
<!--To change the contents of this file, see the documentation on the intelxdk.config.additions.xml file.-->
<intelxdk:version value="1.0"/>
<intelxdk:cordova-cli version="4.1.2"/>
<name>GEOTEST</name>
<description>Template to develop a Cordova mobile web app using the App Designer UI editor.</description>
<author>Intel XDK</author>
<content src="index.html"/>
<access origin="*"/>
<intelxdk:plugin intelxdk:name="Device" intelxdk:value="org.apache.cordova.device" intelxdk:version="0.2.13"/>
<intelxdk:plugin intelxdk:name="SplashScreen" intelxdk:value="org.apache.cordova.splashscreen" intelxdk:version="0.3.5"/>
<preference name="ios-target" value="6"/>
<preference name="ios-configuration" value="adhoc"/>
<!--creationInfo:{"src":"appDesigner","projectTypeName":"com.intel.xdk.projecttype.jsapp"}-->
<preference name="debuggable" value="false"/></widget>

 

0 Kudos
1 Solution
Emre_C_1
Novice
412 Views

John thanks for your reply.

I've finally solved it, it's about IOS Apppreview location permission.

View solution in original post

0 Kudos
4 Replies
John_H_Intel2
Employee
412 Views

When you launched your app, did it prompt you to allow the app to use your location?

0 Kudos
Emre_C_1
Novice
413 Views

John thanks for your reply.

I've finally solved it, it's about IOS Apppreview location permission.

0 Kudos
pedro_v_
Beginner
412 Views

I have the same problem. App works well in Intel XDK Preview, but when not built in Ios app and testing on a Iphone

0 Kudos
PaulF_IntelCorp
Employee
412 Views

Pedro -- is your problem with geolocation or something else? Please start a new thread, I'm closing this one because it is not clear if you issue is related to this one or something different.

0 Kudos
Reply