Foreground Service
This plugin allows for android devices to continue running services in the background, using a foreground ongoing notification. This is targeted towards use with plugins such as 'cordova-geolocation' that will not run while the app is in the background on android API 26+.
For android API 28+, the following xml snippet should be inserted into
config.xml
:
...
<platform name="android">
<config-file parent="/*" target="AndroidManifest.xml">
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
</config-file>
...
Cordovaの問題で困っていますか?

本格的なプロジェクトを構築している場合、トラブルシューティングに時間を費やす余裕はありません。Ionicのエキスパートが、保守、サポート、統合に関する公式サポートを提供しています。
インストール
Ionic Native Enterprise はIonic Teamが完全にサポートしメンテナンスしているプラグインを利用できます。 詳しくみる か、 エンタープライズプラグインに興味があれば 連絡ください
サポートしているプラットフォーム
- Android
利用方法
React
Angular
import { ForegroundService } from '@ionic-native/foreground-service/ngx';
constructor(public foregroundService: ForegroundService) { }
...
startService() {
// Notification importance is optional, the default is 1 - Low (no sound or vibration)
this.foregroundService.start('GPS Running', 'Background Service', 'drawable/fsicon');
}
stopService() {
// Disable the foreground service
this.foregroundService.stop();
}