Geolocation return nothing

Target Meizu u10, android 6
Geolocation returns data only from first starting app if I close app and start it again Geolocation returns nothing( no error, no resul). if I want get data again i need reboot my phone.

Someone had it?

Did you test on other devices with different results?
Do other apps on this device have the same problem?
Show us some code…

Do other apps on this device have the same problem? - No, even google.maps in the application show my position correctly.
At emulator and browser it is working fine but real device has a problem.
I created hollow project and he returns nothing too.
What I do wrong?

import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { Geolocation } from '@ionic-native/geolocation';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html',
  providers: [Geolocation]
})
export class HomePage {

  constructor(public navCtrl: NavController,
  	private geolocation: Geolocation) {
  	geolocation.getCurrentPosition().then((resp) => {
	 console.log(resp)
	}).catch((error) => {
	  console.log('Error getting location', error);
	});

  }

}

also add code from my app

 public ngAfterViewInit() {
    this.diagnostic.isLocationAvailable()
      .then(res => {
        console.log(res)
        if (res) {
        
            this.geolocation.getCurrentPosition().then((resp) => {
             console.log(resp, 'resp');
            }).catch((error) => {
              console.log('Error getting location', error);
            });
    
         this.loadMap();
        }
      }); 
  }

hmm…I have opened chrome and https://www.google.com/maps cant get my location too. Only native app can get it.

Hi I was having the same problem, was driving me crazy. i rebooted the phone and everything was working fine since. Must be a bug.

Keep in mind that aside from the native plugin, you are supposed to validate and authorize the app to use your geoloc coords before it can work (popup on your smartphone when you setup the app, with level of credentials like, authorize the app to use camera, geoloc, so on). So technically, if your app has no credentials, it will always return a null or zero value.

To confirm if this is the issue (or not), you can also test with Ionic View (it’s free), as it comes with built-in checks for that (set to yes, for that kind of checks).

I have met the issue only at meizu u10, another devices work fine, so it’s bug from phone.
Btw, I resolved the issue by get geolocation from native google maps, Have added event at touch.

Thx for the info, native plugins are much easier.