• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Geolocation always muted in iPhone

New Here ,
Jun 23, 2011 Jun 23, 2011

Copy link to clipboard

Copied

1. Installed the last version of Air 2.7;
2. Initialisation of the geolocation class with conditional verification muted / !muted, setRequestedUpdateInterval( 5000 );
3. On the air app xml tried the two ways, UIRequiredDeviceCapabilities ( gps ) and compile with default;
4. Tested in three iPhone's 4;
 

With the all Location Services On the air app always detect that the gps is muted.

Please, does anyone know's what could be the problem?

Cheers,
Bruno

TOPICS
Development

Views

5.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 25, 2011 Jun 25, 2011

Copy link to clipboard

Copied

I'm having the same problem and would appreciate some help.  I've tested on iPad 2, iPod touch as well with no luck. I've also testing using 4.5.0 and 4.5.1 SDKs and neither work.

I've also taken the test code from Adobe's launch pad, INeedIt example, and custom code and all three fail when deployed to iOS.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jun 27, 2011 Jun 27, 2011

Copy link to clipboard

Copied

Can you try resetting Location Warnings at  Settings > general > reset->Reset Location Warnings"? Now again relaunching the app would show the dialog asking for permission.

Thanks,

Sanika

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 27, 2011 Jun 27, 2011

Copy link to clipboard

Copied

Yeah I tried that and that did not work either

Sent from my iPad

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 27, 2011 Jun 27, 2011

Copy link to clipboard

Copied

Hi,

tried a couple of times, doesn't work

cheers

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 27, 2011 Jun 27, 2011

Copy link to clipboard

Copied

Hi All,

Based on the very first post, I guess you have written code similar to below code snippet :

var geo:Geolocation=new Geolocation();// Instantiate Geolocation object

if(!geo.muted) // OS returns "true" by default for all apps on first launch

{

geo.addEventListener(GeolocationEvent.UPDATE,geoEventListener); // asks user for permission by showing dialog, BUT NEVER REACHES here since geo.muted is true

}

else

{

trace("Muted: "geo.muted"\n");

}

whereas the code should be as follows :

var geo:Geolocation=new Geolocation(); // Instantiate Geolocation object

geo.addEventListener(GeolocationEvent.UPDATE,geoEventListener); // Request User to access Location services and shows a dialog on very first launch

if(!geo.muted) // Querring if user denied or approved permission

{

trace("User Denied Permission");

}

else

{

trace("Muted: "geo.muted"\n");

}

Most probably I think above would resolve the issue that you are facing, Please give it a try and let me know if it worked. If not can you please paste your code here ?

Thanks and Regards,

Meet

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 27, 2011 Jun 27, 2011

Copy link to clipboard

Copied

Hey Meet I gave that a try and deployed it and it didn't work. I tried a lot of different variations of this from trying it in the init event, pre init event, and within a button event but this is the last version of it. I also reset the location cache on each try but all are muted.  Pretty frustrating.

Here is my code:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               initialize="app_initializeHandler(event)"
               preinitialize="app_preinitializeHandler(event)">
    <fx:Script>
        <![CDATA[
            import flash.sensors.Geolocation;
            import mx.events.FlexEvent;
           
            protected function app_initializeHandler(event:FlexEvent):void
            {
                var geo:Geolocation = new Geolocation();
               
                // Instantiate Geolocation object
                // Request User to access Location services and
                //shows a dialog on very first launch - NOT TRUE
                geo.addEventListener(GeolocationEvent.UPDATE, geoEventListener);
               
                lblMuted.text = "Mutted: " + geo.muted;
                lblSupported.text = "Supported: " + Geolocation.isSupported.toString();
            }
            protected function geoEventListener(event:GeolocationEvent):void
            {
                lblLat.text = "Lat: " + event.latitude.toString(2);
                lblLng.text = "Lng: " + event.longitude.toString(2);
            }
            protected function app_preinitializeHandler(event:FlexEvent):void
            {
                var geo:Geolocation = new Geolocation();
               
                // Instantiate Geolocation object
                // Request User to access Location services and
                //shows a dialog on very first launch
                geo.addEventListener(GeolocationEvent.UPDATE, geoEventListener);
            }           
        ]]>
    </fx:Script>
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <s:Label id="lblLat" x="10" y="10" text="Lat: ?"/>
    <s:Label id="lblLng" x="10" y="33" text="Lng: ?"/>
    <s:Label id="lblMuted" x="10" y="56" text="Muted: ?"/>
    <s:Label id="lblSupported" x="10" y="79" text="Supported: ?"/>
</s:Application>

Do you have a project zip that you can send that is verified to work?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 27, 2011 Jun 27, 2011

Copy link to clipboard

Copied

Can you declare geo as class level variable and instantiate inside initialize/preinitialize finction ?

private var geo:Geolocation;

protected function app_initializeHandler(event:FlexEvent):void
            {
                geo = new Geolocation();

               ..............

               ..............

            }

I will attach sample code in a short while.

Thanks,

Meet

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jun 27, 2011 Jun 27, 2011

Copy link to clipboard

Copied

Please try the example at http://help.adobe.com/en_US/FlashPlatform/beta/reference/actionscript/3/flash/sensors/Geolocation.html.

Thanks,

Sanika

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 28, 2011 Jun 28, 2011

Copy link to clipboard

Copied

Hi SiggPro,

Did you tried the code at livedocs ?

Thanks,

Meet

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 30, 2011 Jun 30, 2011

Copy link to clipboard

Copied

All - The code Meet has provided works. Thanks for the help and fast replies!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 03, 2012 Sep 03, 2012

Copy link to clipboard

Copied

after 1 year   i meed the same problem。。。

过了1年 我遇到了同样问题 

on air 3.4

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 16, 2012 Sep 16, 2012

Copy link to clipboard

Copied

This is still an issue. IOS6 and Air 3.4. Any solutions?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 16, 2012 Sep 16, 2012

Copy link to clipboard

Copied

Hi Pablomk,

Yes, Geolocation problem on iOS 6 devices is known to us,we're investigating it. Thanks for reporting.

-Pahup

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 21, 2012 Sep 21, 2012

Copy link to clipboard

Copied

on the official version of ios6 . The problem still existed.

I think there are no solutions until Apple fix it .

only way is downgrade to ios5.. or still waiting

在正式的ios6版本中,问题还是存在,而且没有任何办法。只能切换回ios5了。

问题我已经通知国内的adobe技术平台经理,他表示会提交问题给苹果

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 23, 2012 Sep 23, 2012

Copy link to clipboard

Copied

Please follow http://forums.adobe.com/message/4716912#4716912 and let us know how it goes.

-Thanks

Pahup


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 24, 2015 Mar 24, 2015

Copy link to clipboard

Copied

Hello,

Has anyone has any luck on IOS8 and Air17?  On my side I have to manually go to the iPhone's settings to get the Geolocation to work event though I've followed Adobe's guide.

Thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 24, 2015 Mar 24, 2015

Copy link to clipboard

Copied

Please follow Re: geolocation is always muted  in ios8

Please let us know if that works for you.

Thanks,

Adobe Air Team

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 26, 2015 May 26, 2015

Copy link to clipboard

Copied

LATEST

I solved the issue using local shared Object, May be it will help you

https://riteshnewal.wordpress.com/wp-admin/post.php?post=130&action=edit&postpost=v2

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines