Open YoDK opened 8 years ago
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...
@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 ?
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
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.
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!!
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.
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
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
Found a workaround that works for iOS9.1 here: http://stackoverflow.com/questions/26675412/how-do-i-get-the-coordinates-of-the-ios-device-using-rubymotion
Thanks @YoDK ! i've deicded to go this way for now, until BW plays better with ios 9
Since updating to iOS 9.1
BW::Location
seems to no longer return a validCLLocation (:error=>3)
.I can confirm (in 9.1) that
BW::Location.enabled?
returnstrue
andBW::Location.authorized?
also returnstrue
.Also confirmed that the same code in iPhoneSImulator8.4 returns proper
CLLocation