I am facing a problem with Ionic 4 native plugins. I have installed ionic 4 Cordova native plugin "Geolocation" but when I run the app into my iOS or Android device it's showing to me a blank white screen and nothing happening.
app.module.ts
code:
import {
Geolocation
} from '@ionic-native/geolocation';
@NgModule({
declarations: [AppComponent],
entryComponents: [],
imports: [
BrowserModule,
IonicModule.forRoot(),
AppRoutingModule,
ComponentsModule
],
providers: [
StatusBar,
SplashScreen, ** Geolocation ** , {
provide: RouteReuseStrategy,
useClass: IonicRouteStrategy
}
],
bootstrap: [AppComponent]
})
Home.ts
code:
import {
Geolocation
} from '@ionic-native/geolocation';
constructor(private geolocation: Geolocation) {}
I don't know why it's happening. But It's working on Ionic 3 project.
Anyone can give me any idea why it's happening and what I did wrong.
I've found the solution :
@ionic-native/geolocation
to 5.0.0-beta.14 (same as@ionic-native/core
)import {Geolocation} from '@ionic-native/geolocation/ngx';
(in app.module.ts and in your component.ts file)