1 Reply Latest reply on Oct 26, 2011 4:04 PM by kraikit

    GPS and telephone on iOS

    raffialexanian Level 1

      Hi all;


      This is my first app with FB 4.5 for the iOS platform. It is a GIS Map, and when the map loads and the GPS is on, the map should zoom to the location of the device. I tested it on andriod and it works, but not on the iOS. I researched the keys that may be used in the Main-app.xml file, and found the UIRequiredDeviceCapabilities key, however it seems I dont need to call that key and list the gps and location-services as my application can be used without a gps for other functionalities.

      My current Main-app.xml file looks lke this for the iPhone




      am guessing I am missing some other key I should be setting....my code in flash builder looks like this....the main app application complete calls out the first function listed below


      private function init():void

              public var geolocationType:String;
           protected function geolocation_creationCompleteHandler(type:String):void
                if(type == 'onStart')
                     geolocationType = type;
                          geolocationType = 'fButton';
                if( Geolocation.isSupported )
                     g = new Geolocation();
                     locateMeBut.enabled = true;
                     if( g.muted )

                          locateMeBut.enabled = false;
                          myMap.addEventListener(MapEvent.LOAD, goToInitialExtent);
                     g.addEventListener(GeolocationEvent.UPDATE,geoLocation_UpdateHandler, false,0,true);              

                           //don't do anything, gps is not supported or not on



      I also have some text that outputs tel number, and am trying to assign a click to the number text so the phone daials that number, again am probably running into a key that I should be setting for iOS.


      Can anyone please help? Thanks

        • 1. Re: GPS and telephone on iOS
          kraikit Level 2



          Your code looks right; have you done step-debugging on the device to verify that a) geoLocation_UpdateHandler is called, and b) that the GeolocationEvent has valid latitude and longitude properties on it?


          w.r.t. the telephone number, I believe the key is to have the application request a URL with "tel:" as the prefix, e.g. "tel:4155551212" .




          -- Tom