danielsogl / awesome-cordova-plugins

Native features for mobile apps built with Cordova/PhoneGap and open web technologies. Complete with TypeScript support.
https://danielsogl.gitbook.io/awesome-cordova-plugins/
Other
2.39k stars 2.42k forks source link

@ionic-native/status-bar/ngx not working but '@capacitor/core' is. #3336

Closed Jonatthu closed 4 years ago

Jonatthu commented 4 years ago

As a reference https://github.com/ionic-team/ionic-native/issues/3328

This issue is happening as well when I am using Angular 9 with latest ionic

import { SplashScreen } from '@ionic-native/splash-screen/ngx'; import { StatusBar } from '@ionic-native/status-bar/ngx';

These 2 imports are not working as expected after declaring them on providers and injecting them on my app.component.ts constructor.

My packages: "@angular/platform-browser": "~9.0.3", "@angular/platform-browser-dynamic": "~9.0.3", "@angular/router": "~9.0.3", "@capacitor/core": "1.5.0", "@capacitor/ios": "~1.5.0", "@ionic-native/core": "~5.22.0", "@ionic-native/splash-screen": "~5.22.0", "@ionic-native/status-bar": "~5.22.0", "@ionic-native/taptic-engine": "~5.22.0", "@ionic-native/vibration": "~5.22.0",

My current workaround is to call capacitor

//API import { Plugins, StatusBarStyle, } from '@capacitor/core';

danielsogl commented 4 years ago

You cannot use both. If you are using Capacitor the Cordova plugin will not work.

erickmagalhaes commented 4 years ago

see this help me https://medium.com/@razmans/using-cordova-plugins-in-an-ionic-capacitor-project-c17f60e86f23