Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BW::Location no longer accessing CLLocation properly in iOS9.1 #480

Open
YoDK opened this issue Oct 28, 2015 · 10 comments
Open

BW::Location no longer accessing CLLocation properly in iOS9.1 #480

YoDK opened this issue Oct 28, 2015 · 10 comments

Comments

@YoDK
Copy link

YoDK commented Oct 28, 2015

Since updating to iOS 9.1 BW::Location seems to no longer return a valid CLLocation (:error=>3).

I can confirm (in 9.1) that BW::Location.enabled? returns true and BW::Location.authorized? also returns true.

Also confirmed that the same code in iPhoneSImulator8.4 returns proper CLLocation

@soyoh
Copy link

soyoh commented Nov 6, 2015

Hi,
any workaround on this?? i'm having the same problem here. in my case in fails on BW::Location.authorized? and asking for permission...

@YoDK
Copy link
Author

YoDK commented Nov 6, 2015

@soyoh did you include:

  app.frameworks += ['CoreData', 'CoreLocation']
  app.info_plist['NSLocationWhenInUseUsageDescription'] = 'Description.'
  app.info_plist['NSLocationAlwaysUsageDescription'] = 'Description.'

in your apps Motion::Project::App.setup config ?

@YoDK
Copy link
Author

YoDK commented Nov 6, 2015

FYI: Here' a SO post that can help you install the iOS 8.4 Simulator for Xcode 7.1 (last known working config for BW::Location) - http://stackoverflow.com/questions/33377837/error-sdk-iphonesimulator9-0-cannot-be-located

@markrickert
Copy link
Collaborator

The app.frameworks line shouldn't be required here. Bubblewrap automatically includes CoreLocation for you, and CoreLocation doesn't require CoreData as far as I know.

@soyoh
Copy link

soyoh commented Nov 6, 2015

Hi Guys,
Thanks, i managed to see the permissions alert (it was because i missed "NSLocationAlwaysUsageDescription"), but now my app crashes when using "Location::get_once""

this is the error:

2015-11-07 00:35:14.348 app[89887:5025324] functions.rb:15:in `block in get_location_and_users': wrong number of arguments (0 for 1) (ArgumentError)
    from functions.rb:15:in `locationManager:didUpdateLocations:'
2015-11-07 00:35:14.361 app[89887:5025324] expected Proc with 1 arguments (got 0) (ArgumentError)

and this is the code i'm using:

BW::Location.get_once(desired_accuracy: :three_kilometers) do |result|
      mp.result
      if result.is_a?(CLLocation)
        mp result.coordinate.latitude
        mp result.coordinate.longitude
      else
        mp "ERROR: #{result[:error]}"
      end
    end

well, i'm using the simulator, i suppouse that is because of this, and it doesnt provide a location, do you know how can i "fake" it??

any hint? thank you!!

@YoDK
Copy link
Author

YoDK commented Nov 7, 2015

I'm not sure about the BW error. But you can set the GPS location of the Simulator by going to Debug > Location > Custom Location

Then I use Google Maps to give me the longitude and latitude of a location I'm interested in.

@markrickert
Copy link
Collaborator

The sun has always had an issue where it return an error every once in a while. Try turning off the location in the sim and then reactivating it and trying again

OMG... Yes I did just suggest "have you tried turning it off and back on again?" Lol

@soyoh
Copy link

soyoh commented Nov 7, 2015

haha, i already tried that @markrickert i tried turning off location, removing permissions, and removing app to ask permissions again... the same error happens
ios SDK 9.1 and deployment_target 8.4 or 9.0

@YoDK
Copy link
Author

YoDK commented Nov 9, 2015

@soyoh
Copy link

soyoh commented Nov 10, 2015

Thanks @YoDK ! i've deicded to go this way for now, until BW plays better with ios 9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants