Unsolved Qt Positioning not working in iOS
-
I ask for the location at the begining of the program so it shows same time application starts.
Btw I did not add anything to my Info.plist, so I am not sure if it is required -
I tried again with a Hello world application from scratch. It still doesn't work. I didn't write a particular info.plist, so it was autogenerated by qmake. Application starts normally, but I don't get any dialog asking for permission to provide location and of course positionUpdated() still isn't emitted.
I tried both real device and iOS Simulator with simulated location.
Any ideas what else I should try? -
Maybe try examples available, like: "Weather Info"?
-
Weather info doesn't work either. It just shows "Loading weather data" indefinitely.
-
What version of iOS and Xcode are you using ? (latest can change pretty quickly)
-
I have Xcode 7.1.1 and iOS 9.1 both on device and simulator. I added this information to the first post.
I already verified that I can make a Hello World iOS app in XCode, which successfully obtains user position using native code (CLLocationManager).
-
You might need to add the following keys to your plist
- NSLocationAlwaysUsageDescription
- NSLocationWhenInUseUsageDescription
You also may need to add either of the following to your project file
QT += positioning sensors
-
I already implemented this using native code. But thanks. Maybe this helps somebody else.
BTW I used the class CLLocationManager-blocks (https://github.com/axldyb/CLLocationManager-blocks). Thanks to this I was able to implement it by a brief Objective-C snippet in a QObject subclass. The position-update-handler was just an objective-C Block rather than Delegate. Writing the Delegate would have required to subclass NSObject.
-
@ldanzinger All you need to do in order to get QTPositioning to work is add <key>NSLocationAlwaysUsageDescription</key>
to your info.plist file.create an iOS folder in the root of your project and place your info.plist file in there then add the following to you .pro file
ios {
QMAKE_INFO_PLIST = ios/Info.plist
}This fixes the geoflickr example qt quick app.
-
IOS10.2
work only simulator, on device not workQGeoPositionInfoSource::createDefaultSource(0) is NULL
-
Did you got asked for permission ?
-
I ask for the location at the begining of the program so it shows same time application starts.
Btw I did not add anything to my Info.plist, so I am not sure if it is required -
@SGaist
ask permision only simulator
on real device dont ask -
Then check that you allowed the GPS to be used.
-
@SGaist where check?
in device Settings->Privacy->Location Service
there is no my application -
Then delete the application from your device and install it again. Do not just re-run your application, nuke it from the device before starting it again.