You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by slack-mail <pu...@gmail.com> on 2019/03/20 07:11:17 UTC

[slack-digest] [2019-03-19] #plugins

2019-03-19 14:03:10 UTC - Henning H. Haugen: I have an issue with the `cordova-plugin-geolocation`. In iOS, when i request the location, I get two popups. The first one is correct with "&lt;AppName&gt; would like to use your current location", but when I accept that one, another comes up with " "/var/containers/Bundle/Application/B08D3E87-=FCF-3928-BC- .... /&lt;AppName&gt;.app/www/index.html" would like to use your current location"
----
2019-03-19 14:04:09 UTC - julio cesar: that happens when you didn't install the plugin correctly
----
2019-03-19 14:04:58 UTC - Henning H. Haugen: I've just ran `cordova plugin add cordova-plugin-geolocation`
----
2019-03-19 14:06:46 UTC - Henning H. Haugen: I also see this under iOS Quirks ```&lt;edit-config target="NSLocationWhenInUseUsageDescription" file="*-Info.plist" mode="merge"&gt;
    &lt;string&gt;need location access to find things nearby&lt;/string&gt;
&lt;/edit-config&gt;```
----
2019-03-19 14:06:56 UTC - Henning H. Haugen: Which didnt change anything
----
2019-03-19 14:15:17 UTC - julio cesar: and how does your code look like?
----
2019-03-19 14:19:47 UTC - Henning H. Haugen: ```window.navigator.geolocation.getCurrentPosition(function(position){
			<http://axios.post|axios.post>('<https://api.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>', {
				lat: position.coords.latitude,
				lng: position.coords.longitude
			})
			.then(function (response) {
				data = response.data.data;
				if(response.data.status === 1){
					localStorage.setItem('xxxxxx', JSON.stringify(response.data.data));
					self.$f7router.navigate('/xxx', {
						props: {
							xxx: data.id,
						}
					})
				}else{
					console.log(response);
				}
			})
			.catch(error =&gt; this.setState({error, isLoading: false}));
		}, function(error){
			console.log(error)
		});```
----
2019-03-19 14:22:08 UTC - julio cesar: looks good
----
2019-03-19 14:22:36 UTC - julio cesar: Check on Xcode that the plugin js files are there
----
2019-03-19 14:23:22 UTC - julio cesar: There should be a yellow "staging" folder with a blue www folder and it should contain a plugins folder with all your plugins code
----
2019-03-19 14:24:54 UTC - Henning H. Haugen: Yeah the cordova-plugin-geolocation plugin isnt located there
----
2019-03-19 14:25:23 UTC - Henning H. Haugen: platform rm ios then?
----
2019-03-19 14:25:26 UTC - Henning H. Haugen: and add again
----
2019-03-19 14:39:21 UTC - Henning H. Haugen: That worked nicely! Thanks alot @julio cesar
----