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
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.
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
Copy link to clipboard
Copied
Yeah I tried that and that did not work either
Sent from my iPad
Copy link to clipboard
Copied
Hi,
tried a couple of times, doesn't work
cheers
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
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?
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
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
Copy link to clipboard
Copied
Hi SiggPro,
Did you tried the code at livedocs ?
Thanks,
Meet
Copy link to clipboard
Copied
All - The code Meet has provided works. Thanks for the help and fast replies!
Copy link to clipboard
Copied
after 1 year i meed the same problem。。。
过了1年 我遇到了同样问题
on air 3.4
Copy link to clipboard
Copied
This is still an issue. IOS6 and Air 3.4. Any solutions?
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
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技术平台经理,他表示会提交问题给苹果
Copy link to clipboard
Copied
Please follow http://forums.adobe.com/message/4716912#4716912 and let us know how it goes.
-Thanks
Pahup
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!
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
Copy link to clipboard
Copied
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