Skip to main content
eyalgaon84
Participant
June 13, 2011
Question

Geolocation iPhone

  • June 13, 2011
  • 6 replies
  • 2517 views

Hi,

I'm trying to get the location using this code:

import flash.sensors.Geolocation;

import flash.events.GeolocationEvent;

if (Geolocation.isSupported)

{

var locale:Geolocation = new Geolocation();

if(locale.muted){

     txt1.text = "Geolocation is muted";

}

locale.addEventListener(GeolocationEvent.UPDATE, onlocationHandler);

locale.setRequestedUpdateInterval(2000);

}

else

{

      txt1.text = "Geolocation is not Supported";

}

When I run this on my iPhone 4g, I always get "Geolocation is muted"

I think that should be a message asking me to approve the use of GPS, but I don't get this message

Does anyone know why this happens?

This topic has been closed for replies.

6 replies

Participating Frequently
June 25, 2011

I have the same problem and I'm never prompted for permission.  The app also never shows up in the locations list of applications.  Please help!

June 27, 2011

Hi,

Can you please try the code posted in forum post http://forums.adobe.com/message/3764777#3764777 and see if it works ?

Participating Frequently
June 28, 2011

Meet I tried that code and it doesn't work.  Do you have a project zip or link from Adobe you can share with the community?

relaxatraja
Inspiring
June 21, 2011

The thing to check muted is fixed in AIR 2.7

Participant
June 21, 2011

might be, that this is fixed, however, i never get the dialog to allow the app to use geolocation, so always muted.

any idea ?

thanks

Participant
June 23, 2011

Hi,

just posted the same problem.

I've installed the version 2.7 and the problem of muted gps in iPhone stills in.

Cheers.

Participant
June 17, 2011

Hello,

i tried with 2.7, but it is still muted, and i do not get the question from ios to allow location, so this is my problem i guess.

In my app.xml i set the following, which does not help at all, what i'm doing wrong:

<iPhone>
    <InfoAdditions>
        <![CDATA[
            <key>UIDeviceFamily</key>
            <array>
                <string>2</string>
            </array>
            <key>UIRequiredDeviceCapabilities</key>
            <array>
                <string>location-services</string>
            </array>
        ]]>
    </InfoAdditions>
</iPhone>

please help

thanks

martin

June 14, 2011

Hi,

Yes it is bug in 2.6 which is fixed in the next version. But you should get GeolocationUpdate events irrespective of muted value if you have allowed the app to use Location Services.

iOS shows the dialog requesting the user's permission the very first time an application is launched. So you must have got the dialog first time you installed the app. However on subsequent re-installs, iOS will not show the dialog since it reloads the application's documents and user preferences from the applications directory. You can reset it by Resetting Location Warnings in "settings > general > reset". Now again relaunching the app would show the dialog asking for permission.

Thanks,

Meet

Participating Frequently
June 14, 2011

Hi,

muted property always being true is a bug, which is fixed in AIR 2.7. Please try it when AIR 2.7 is available.

Thanks,

Sanika

relaxatraja
Inspiring
June 14, 2011

Yes, If the user denied the access then it always true. so check whether you enabled gps in iphone.

http://www.republicofcode.com/tutorials/flash/as3geolocation/

http://www.adobe.com/devnet/air/quick_start_as/quickstarts/qs_as_geolocation_api.html