i have build my own app and published it to the app store.
Its available on store, but there is a problem.
Im working with Geolocation and google maps.
Here is a link to Phonegap's Geolocation:
phonegap geolocation
When i start my app on Phonegap app emulator, i get asked to accept the geolocation, so the app has access to it.
It works fine! i get my longitude and latitude and can work with it.
But the same app, downloaded from the app store, doesn't work.
I don't get asked to allow geolocation, and even on settings there is not a sign to me where i can turn it on.
Screenshot from the app, google maps, with lat & long = 0 (default).
Aka no geolocation working.
Anyone facing the same issue? Any ideas?
greets Luca
Edit your config.xml
add this line of code
<plugin name="cordova-plugin-geolocation" spec="~4.0.1" />
<edit-config target="NSLocationWhenInUseUsageDescription" file="*-Info.plist" mode="merge">
<string>need location access to find things nearby</string>
</edit-config>
Related
I want to use getUserMedia api to access camera in wkwebview, api working fine on android webview but ios is not, below is what i tried
ionic cordova plugin add cordova-plugin-camera
<plugin name="cordova-plugin-camera" spec="^6.0.0" />
<edit-config file="*-Info.plist" mode="merge" target="NSCameraUsageDescription">
<string>Used to take pictures</string>
</edit-config>
also manually add the string in Info.plist file
but it only works on safari, on ionic app it shows no error but no response nor asking for camera permission
Thanks!
I develop an app that uses geolocation for iOS using Ionic 3. The app was rejected I need to change the app request for location message.
I follow the iOS quirk mention in cordova geolocation plugin page without luck:
<edit-config target="NSLocationWhenInUseUsageDescription" file="*-Info.plist" mode="merge">
<string>need location access to find things nearby</string>
</edit-config>
I tried another variable NSLocationAlwaysUsageDescription, and both variables. I uninstall and install again the geolocation plugin. I try many answer to "similar" questions but nothing seems to work.
Somethings to note:
I also use BackgruondGeolocation plugin.
Part of the packages
“#ionic-native/background-geolocation”: “^4.12.2”,
“#ionic-native/core”: “~4.11.0”
“#ionic-native/geolocation”: “^4.12.0”,
…
“ionic-angular”: “3.9.2”
I notice that if i add the <edit-config> entry at the end of <platform name="ios"> it gives me a conflict message when building but it ends, no message if it is at the start. It does not work either way.
Please someone help me.
According to the documentation, you have to add this key to your Info.plist :
NSLocationWhenInUseUsageDescription, NSLocationAlwaysAndWhenInUseUsageDescription and NSLocationAlwaysUsageDescription
You are required to include the NSLocationWhenInUseUsageDescription and NSLocationAlwaysAndWhenInUseUsageDescription keys in your app's Info.plist file. (If your app supports iOS 10 and earlier, the NSLocationAlwaysUsageDescription key is also required.) If those keys are not present, authorization requests fail immediately.
I tried changing in the AppName-Info.plist to the description I want but after the build it gets automatically replaced by the default one over below.
<key>NSLocationWhenInUseUsageDescription</key>
<string>$NSLocationWhenInUseUsageDescription</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>$NSLocationAlwaysUsageDescription</string>
I also tried removing the cordova geolocation plugin and reinstalling as
cordova plugin add https://github.com/apache/cordova-plugin-geolocation.git --variable GEOLOCATION_USAGE_DESCRIPTION="Allow location access for maps"
but still it doesn't change the description. What I still get on my app is $NSLocationWhenInUseUsageDescription as my description.
I'm a little late to this post but I came across it while searching for an answer to the same problem. I ended up adding the following code to my ionic project config.xml file and after building and testing I can confirm that this worked.
<config-file parent="NSLocationWhenInUseUsageDescription" platform="ios" target="*-Info.plist">
<string>This app requires access to your location when the screen is on and the app is displayed to Lorem Ipsum. Your code here.</string>
</config-file>
I also attached a picture showing where that bit of code went in terms of the rest of the file.
Location Permission Example
My IOS app is location depend. I have to test the app by setting different fake GPS locations on real IOS 9.3.1 devices. I searched Fake location app but nothing worked as expected. Most of the app are related to take photo and share on fb or twitter with fake location. These app are not changing the device gps location
My client need to test the app in different location. He is able to do the same in android and expecting the same from IOS. Any idea apart from debug mode.
Is it possible to set fake location in IOS real device.
You can do this if you have the device connected to the computer in debug mode through XCode. Go to Debug -> Simulate Location and select one of the pre-existing locations.
Alternatively, you can add your own GPX file to the project simulate any other custom location. Your GPX file would look similar to this, you would just need to update the latitude and longitude.
<?xml version="1.0" encoding="UTF-8"?>
<gpx version="1.0">
<wpt lat="46.57638889" lon="8.89263889">
<name>LAGORETICO</name>
</wpt>
</gpx>
See this link for more details on how to write your own GPX file.
This link, although slightly outdated, has a great example of how to do this from start to finish.
i have created an iPhone App with cordova and the google maps Plugin for Cordova (https://github.com/wf9a5m75/phonegap-googlemaps-plugin). I entered the API Key for Ios and on the Emulator it works great. Also when i test it on my iPhone it works. So i submitted the app to the AppStore and after it gets reviewed i downloaded it from the Appstore but the Map is blank. There are no Control Elements like when the API Key is wrong. Now my question is what i should do now?
I tried:
<access origin="*" />
Changing Bundle Identifier
Check API Key
Take the IPA and installed it manually on a iPhone/iPad (the Map works)
So i think the Probleme must came from Apple or do i see that wrong?
Thanks in advance
The phonegap-googlemaps-plugin is not subjected by <access origin="*" />, because the Google Maps SDK for iOS connects to the internet directly.
Typically the bundle identifier and the API key are mismatch.
Google Maps iOS SDK Integration not loading maps
Is there any error message in Xcode?