Geo Location API not working on iOS 8 ?

Hi

I am new to both ruby and rhodes. I have been using Geo Location API in my app which works fine on iOS7.But when i build the app for iOS8 using Xcode 6 and rhodes4.1.1 I always get the positioning co-ordinates as 0 from the API itself.

is there any workaround for this so that the API works.

I tried building the app with 5.0.2 but i get an error as given below :

ld: symbol(s) not found for architecture armv7

  ==================== ERROR! ====================

clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **

The following build commands failed:

    Ld build/Release-iphoneos/rhorunner.app/rhorunner normal armv7

(1 failure)

cd /Users/varalakshmip/.rvm/gems/ruby-1.9.3-p547/gems/rhodes-5.0.2

************************************

ERROR during building by XCode !

XCode return next error code = pid 95524 exit 65

which i could not understand


Any help is appreciated in regards to make the GEo Location API work on iOS8???


Thanks

Siddhant

Dmitry Soldatenkov
Hi,Please post full console

Hi,

Please post full console output for "rake run:iphone --trace" or full build log from XCode.

If you use XCode project generated in 4.0, you should regenerate it by 5.0 (remove app_folder/project/iphone and regenerate by "rake build:iphone:setup_xcode_project")

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Kutir Mobility
Hi SiddhantI see already

Hi Siddhant

I see already shared his experience about building Rhodes app for iOS8 at https://developer.motorolasolutions.com/message/81609#81609

Was that helpful to you ?

Thank you.

Visnupriya R

Kutir Mobility

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Paul Goh
Hi Siddhant,Your post was

Hi Siddhant,

Your post was earlier in the month, so you may have found a work around already.

GeoLocation API needs some changes to work with IOS 8.0. This post I found online explains the changes to the LocationManager in IOS 8.x SDK quite well is http://nevan.net/2014/09/core-location-manager-changes-in-ios-8/

Workaround that we are using for now is, updating the initLocationManger method in <XcodeProjectPath>/Classes/GeoLocation/LocationController.m as below:

- (void) initLocationManager:(NSObject*)param {

    self._locationManager = [[[CLLocationManager alloc] init] autorelease];

    self._locationManager.desiredAccuracy = kCLLocationAccuracyBest;

    self._locationManager.delegate = self; // Tells the location manager to send updates to this object

 

    // Workaround for IOS 8 SDK LocationManager changes

    if ([self._locationManager respondsToSelector:@selector(requestAlwaysAuthorization)]) {

        [self._locationManager requestAlwaysAuthorization];

    }

}

and updating Info.plist file with string values for NSLocationAlwaysUsageDescription and NSLocationWhenInUseUsageDescription.

A formal fix would be ideal, but I haven't seen if something like this has made into Rhodes GIT repo or Rho 5.x

Would be great to hear if there are any other solutions / workarounds for this.

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


Siddhant Wadhera
Hi PaulThanks for the answer

Hi Paul

Thanks for the answer i have been very busy lately but for sure i will give this a try

Thanks

Siddhant

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Kutir Mobility
Hi Have you tried Paul's

Hi

Have you tried Paul's suggestion and tried to solve your problem ?

Thank you.

Visnupriya R

Kutir Mobility

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Siddhant Wadhera
Hi Visnupriyano I haven't

Hi Visnupriya

no I haven't tried this as i have been busy very lately.Though the solution looks promising

I have marked the answer as helpful

Thanks

Siddhant

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Vincent Lagneau
Hi Paul,My answer might be a

Hi Paul,

My answer might be a little late, but it might help other people later struggling with GPS on iOS 8.

First of all, thank you for this solution and the link to the post explaining the changes in the LocationManager for iOS 8. It helped me a lot.

It worked perfectly on rhodes 5.0.25 and an iPad mini running on iOS 8.1.3. After installing my app, on the first use, it asks me if it can use the GPS and if I accept the GPS works perfectly.

But then, another problem appeared : after closing the app and restarting it, the GPS didn't work anymore on the application.

So I dug a bit, and used the link you provided. The permission was okay for my app, as I accepted it on the first run. But still, the GPS wasn't working on my app after the first run and the acceptance of the use of the GPS.

So I took a look at the update function in the LocationController.m, the function called (bool)update. And I saw that the new authorization statuses used on IOS 8 weren't taken into account. So I simply added the status that I needed to be checked (in my case "kCLAuthorizationStatusAuthorizedWhenInUse") , and it works perfectly now. Here's how my update function looks like :

- (bool)update{

      @synchronized(self) {

          if (!_locationManager)

              return false;

          if (!_locationManager.locationServicesEnabled)

              return false;

          if (![CLLocationManager locationServicesEnabled])

              return false;

          if (([CLLocationManager authorizationStatus] != kCLAuthorizationStatusAuthorized) &&

              ([CLLocationManager authorizationStatus] != kCLAuthorizationStatusNotDetermined) &&

              ([CLLocationManager authorizationStatus] != kCLAuthorizationStatusAuthorizedWhenInUse) ) // Here's my fix

              return false;

          isEnabled = YES;

          _locationManager.delegate = self; // Tells the location manager to send updates to this object

          if (_bMinDistanceMode) {

              _locationManager.distanceFilter = _dMinDistance;

              _locationManager.desiredAccuracy = _dMinDistance;

              [_locationManager startUpdatingLocation];

          }

          else {

              _locationManager.distanceFilter = kCLDistanceFilterNone;

              _locationManager.desiredAccuracy = kCLLocationAccuracyBest;

              [_locationManager startUpdatingLocation];

          }

      }

      return true;

  }

I hope this might help some other people having troubles with the GPS.

Once again, thanks Paul.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Jon Tara
Vincent, did you make an

Vincent, did you make an Issue on Github about this? It's great that you've posted your patches here for others to change it themselves! But let's make sure it feeds back into the product, as well. You can also make a pull request for your changes, but I think I would avoid that here since this part seems under active development, so I'd think it best to post an Issue to make sure developers know and take it from there.

    Issues · rhomobile/rhodes · GitHub

The developers do read this forum, so hopefully they will notice - or maybe they have already fixed it in not-yet-released code. But it would be better to be sure!

FYI, a new release seems "on-deck". There's a new branch in the repo called 5-0-sp3-stable. Given the arcane labeling being used in the repo, and that 5-0-sp2-stable corresponds to 5.0.25, then I'd guess that this will be the basis of the next release, 5.0.?? (> .25) There has been a LOT of activity in that branch, (and master) including 64-bit iOS support and new camera API. Developers have bene hard at work, and so I would expect something soon.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Jon Tara
Ah, Paul's fix (or similar)

Ah, Paul's fix (or similar) has already been applied, and should appear in the next release then. That Issue has been closed:

iOS 8.1 GPS problem with Rhodes 5.0.0 · Issue #451 · rhomobile/rhodes · GitHub

You might want to review the code on the master branch, and if it does not have your additional fix, please file a new Issue.

Thanks for pitching-in! The team is very responsive to users who go the extra mile.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Vincent Lagneau
Thanks for your advice and

Thanks for your advice and the information Jon, I hadn't thought about making an issue on the Rhodes Github for the team to work on it. Indeed, it would be better to be sure that this is fixed !

I'll check their changes on the iOS GPS API, since they worked on Paul's fix, and open an issue only if it is needed.


Thanks for your help.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Vincent Lagneau
Has you said Jon, the devs

Has you said Jon, the devs worked on this API and the issue as already been patched.

For the people that are interested in seeing the changes : rhodes/LocationController.m at 5-0-sp3-stable · rhomobile/rhodes · GitHub

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments