开发者

Occupy GPS resource on iOS (using Geolocation Class, Adobe AIR)

开发者 https://www.devze.com 2023-03-30 03:38 出处:网络
I am developing iOS app by Adobe AIR. I found that if use Geolocation class in iOS platform, it would occupy GPS resource and other apps could not use GPS feature.

I am developing iOS app by Adobe AIR.

I found that if use Geolocation class in iOS platform, it would occupy GPS resource and other apps could not use GPS feature.

Does anyone find the same thing?

I'm not sure that it's my wrong codes or a bug of Adobe AIR.

Followings are my codes:

    private var geolocation:Geolocation;

    private开发者_StackOverflow中文版 function geolocationGet():void{
        geolocation = new Geolocation();
        geolocation.setRequestedUpdateInterval(100);
        geolocation.addEventListener(GeolocationEvent.UPDATE, geoUpdateHandler);
    }

    private function geoUpdateHandler(e:GeolocationEvent):void{
        geolocation.removeEventListener(GeolocationEvent.UPDATE, geoUpdateHandler);
        trace("latitude: "+e.latitude+", longitude: "+e.longitude);
    }


it's probably because you're hogging the gps by making requests too often. it's probably not even being able to cope with the first response, so everything is getting clogged up. change the setRequestedUpdateInterval to something like 3000 rather than 100 milliseconds cos it should work.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号